package b.i.b;

import android.animation.ObjectAnimator;
import android.annotation.SuppressLint;
import android.app.Activity;
import android.app.AppOpsManager;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.content.pm.ActivityInfo;
import android.content.pm.PackageManager;
import android.content.pm.PackageManager.NameNotFoundException;
import android.content.res.ColorStateList;
import android.content.res.Resources;
import android.content.res.Resources.Theme;
import android.content.res.TypedArray;
import android.graphics.Color;
import android.graphics.Paint.FontMetricsInt;
import android.graphics.Path;
import android.graphics.PointF;
import android.graphics.PorterDuff.Mode;
import android.graphics.Rect;
import android.graphics.drawable.Drawable;
import android.graphics.drawable.DrawableContainer;
import android.graphics.drawable.DrawableContainer.DrawableContainerState;
import android.graphics.drawable.InsetDrawable;
import android.icu.text.DecimalFormatSymbols;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.net.NetworkInfo.State;
import android.net.Uri;
import android.os.Build.VERSION;
import android.os.Bundle;
import android.os.CancellationSignal;
import android.os.Environment;
import android.os.IBinder;
import android.os.Looper;
import android.os.Parcel;
import android.os.ParcelFileDescriptor;
import android.os.Parcelable;
import android.os.Parcelable.Creator;
import android.os.Process;
import android.telephony.TelephonyManager;
import android.text.TextDirectionHeuristic;
import android.text.TextDirectionHeuristics;
import android.text.TextPaint;
import android.text.TextUtils;
import android.text.method.PasswordTransformationMethod;
import android.util.AttributeSet;
import android.util.Base64;
import android.util.Log;
import android.util.Property;
import android.util.StateSet;
import android.view.ActionMode.Callback;
import android.view.View;
import android.widget.CompoundButton;
import android.widget.PopupWindow;
import android.widget.TextView;
import androidx.recyclerview.widget.RecyclerView.m;
import androidx.recyclerview.widget.RecyclerView.w;
import b.i.i.b.a;
import b.p.b.z;
import c.a.a.b0.j.b;
import c.a.a.b0.j.d;
import c.a.a.d0.e;
import c.a.a.d0.g0;
import c.a.a.d0.h;
import c.a.a.d0.n;
import c.a.a.d0.q;
import c.a.a.d0.v;
import c.a.a.e0.g;
import c.c.a.m0;
import c.c.a.x;
import c.c.c.a.e.c;
import com.bun.miitmdid.core.JLibrary;
import com.huawei.hms.api.ConnectionResult;
import com.huawei.hms.framework.common.ContainerUtils;
import com.huawei.hms.support.api.entity.pay.HwPayConstant;
import com.pgl.sys.ces.out.ISdkLite;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.PrintWriter;
import java.lang.reflect.Array;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.net.URL;
import java.nio.ByteBuffer;
import java.nio.MappedByteBuffer;
import java.nio.channels.FileChannel;
import java.nio.channels.FileChannel.MapMode;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Collections;
import java.util.IdentityHashMap;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.Objects;
import java.util.Set;
import java.util.TimeZone;
import org.json.JSONException;
import org.json.JSONObject;
import org.xmlpull.v1.XmlPullParser;
import org.xmlpull.v1.XmlPullParserException;

/* compiled from: AppOpsManagerCompat */
public final class f {
    public static Method a;
    public static boolean b;
    public static Method c;
    public static boolean d;
    public static Field e;
    public static boolean f;
    public static Method g;
    public static boolean h;
    public static Field i;
    public static boolean j;

    public static boolean A(String str) {
        return str.equals("POST") || str.equals("PUT") || str.equals("PATCH") || str.equals("PROPPATCH") || str.equals("REPORT");
    }

    public static a A0(TextView textView) {
        int i = VERSION.SDK_INT;
        if (i >= 28) {
            return new a(textView.getTextMetricsParams());
        }
        int i2;
        int i3;
        TextDirectionHeuristic textDirectionHeuristic;
        TextPaint textPaint = new TextPaint(textView.getPaint());
        int i4 = 0;
        if (i >= 23) {
            i2 = 1;
            i3 = 1;
        } else {
            i2 = 0;
            i3 = 0;
        }
        TextDirectionHeuristic textDirectionHeuristic2 = TextDirectionHeuristics.FIRSTSTRONG_LTR;
        if (i >= 23) {
            i2 = textView.getBreakStrategy();
            i3 = textView.getHyphenationFrequency();
        }
        if (textView.getTransformationMethod() instanceof PasswordTransformationMethod) {
            textDirectionHeuristic = TextDirectionHeuristics.LTR;
        } else if (i < 28 || (textView.getInputType() & 15) != 3) {
            if (textView.getLayoutDirection() == 1) {
                i4 = 1;
            }
            switch (textView.getTextDirection()) {
                case 2:
                    textDirectionHeuristic = TextDirectionHeuristics.ANYRTL_LTR;
                    break;
                case 3:
                    textDirectionHeuristic = TextDirectionHeuristics.LTR;
                    break;
                case 4:
                    textDirectionHeuristic = TextDirectionHeuristics.RTL;
                    break;
                case 5:
                    textDirectionHeuristic = TextDirectionHeuristics.LOCALE;
                    break;
                case 6:
                    textDirectionHeuristic = TextDirectionHeuristics.FIRSTSTRONG_LTR;
                    break;
                case 7:
                    textDirectionHeuristic = TextDirectionHeuristics.FIRSTSTRONG_RTL;
                    break;
                default:
                    if (i4 == 0) {
                        textDirectionHeuristic = TextDirectionHeuristics.FIRSTSTRONG_LTR;
                        break;
                    }
                    textDirectionHeuristic = TextDirectionHeuristics.FIRSTSTRONG_RTL;
                    break;
            }
        } else {
            byte directionality = Character.getDirectionality(DecimalFormatSymbols.getInstance(textView.getTextLocale()).getDigitStrings()[0].codePointAt(0));
            if (directionality == (byte) 1 || directionality == (byte) 2) {
                textDirectionHeuristic = TextDirectionHeuristics.RTL;
            } else {
                textDirectionHeuristic = TextDirectionHeuristics.LTR;
            }
        }
        return new a(textPaint, textDirectionHeuristic, i2, i3);
    }

    /* JADX WARNING: Missing block: B:9:0x0026, code skipped:
            if (r10.bottom <= r12.top) goto L_0x0043;
     */
    /* JADX WARNING: Missing block: B:13:0x0033, code skipped:
            if (r10.right <= r12.left) goto L_0x0043;
     */
    /* JADX WARNING: Missing block: B:15:0x003a, code skipped:
            if (r10.top >= r12.bottom) goto L_0x0043;
     */
    /* JADX WARNING: Missing block: B:17:0x0041, code skipped:
            if (r10.left >= r12.right) goto L_0x0043;
     */
    /* JADX WARNING: Missing block: B:19:0x0045, code skipped:
            r7 = null;
     */
    public static boolean B(int r9, android.graphics.Rect r10, android.graphics.Rect r11, android.graphics.Rect r12) {
        /*
        r0 = C(r9, r10, r11);
        r1 = C(r9, r10, r12);
        r2 = 0;
        if (r1 != 0) goto L_0x007d;
    L_0x000b:
        if (r0 != 0) goto L_0x000f;
    L_0x000d:
        goto L_0x007d;
    L_0x000f:
        r0 = "direction must be one of {FOCUS_UP, FOCUS_DOWN, FOCUS_LEFT, FOCUS_RIGHT}.";
        r1 = 130; // 0x82 float:1.82E-43 double:6.4E-322;
        r3 = 33;
        r4 = 66;
        r5 = 17;
        r6 = 1;
        if (r9 == r5) goto L_0x003d;
    L_0x001c:
        if (r9 == r3) goto L_0x0036;
    L_0x001e:
        if (r9 == r4) goto L_0x002f;
    L_0x0020:
        if (r9 != r1) goto L_0x0029;
    L_0x0022:
        r7 = r10.bottom;
        r8 = r12.top;
        if (r7 > r8) goto L_0x0045;
    L_0x0028:
        goto L_0x0043;
    L_0x0029:
        r9 = new java.lang.IllegalArgumentException;
        r9.<init>(r0);
        throw r9;
    L_0x002f:
        r7 = r10.right;
        r8 = r12.left;
        if (r7 > r8) goto L_0x0045;
    L_0x0035:
        goto L_0x0043;
    L_0x0036:
        r7 = r10.top;
        r8 = r12.bottom;
        if (r7 < r8) goto L_0x0045;
    L_0x003c:
        goto L_0x0043;
    L_0x003d:
        r7 = r10.left;
        r8 = r12.right;
        if (r7 < r8) goto L_0x0045;
    L_0x0043:
        r7 = 1;
        goto L_0x0046;
    L_0x0045:
        r7 = 0;
    L_0x0046:
        if (r7 != 0) goto L_0x0049;
    L_0x0048:
        return r6;
    L_0x0049:
        if (r9 == r5) goto L_0x007c;
    L_0x004b:
        if (r9 != r4) goto L_0x004e;
    L_0x004d:
        goto L_0x007c;
    L_0x004e:
        r11 = D0(r9, r10, r11);
        if (r9 == r5) goto L_0x006f;
    L_0x0054:
        if (r9 == r3) goto L_0x006a;
    L_0x0056:
        if (r9 == r4) goto L_0x0065;
    L_0x0058:
        if (r9 != r1) goto L_0x005f;
    L_0x005a:
        r9 = r12.bottom;
        r10 = r10.bottom;
        goto L_0x0073;
    L_0x005f:
        r9 = new java.lang.IllegalArgumentException;
        r9.<init>(r0);
        throw r9;
    L_0x0065:
        r9 = r12.right;
        r10 = r10.right;
        goto L_0x0073;
    L_0x006a:
        r9 = r10.top;
        r10 = r12.top;
        goto L_0x0073;
    L_0x006f:
        r9 = r10.left;
        r10 = r12.left;
    L_0x0073:
        r9 = r9 - r10;
        r9 = java.lang.Math.max(r6, r9);
        if (r11 >= r9) goto L_0x007b;
    L_0x007a:
        r2 = 1;
    L_0x007b:
        return r2;
    L_0x007c:
        return r6;
    L_0x007d:
        return r2;
        */
        throw new UnsupportedOperationException("Method not decompiled: b.i.b.f.B(int, android.graphics.Rect, android.graphics.Rect, android.graphics.Rect):boolean");
    }

    public static void B0(String str, String str2) {
        Log.i(y0(str), str2);
    }

    public static boolean C(int i, Rect rect, Rect rect2) {
        boolean z = true;
        if (i != 17) {
            if (i != 33) {
                if (i != 66) {
                    if (i != 130) {
                        throw new IllegalArgumentException("direction must be one of {FOCUS_UP, FOCUS_DOWN, FOCUS_LEFT, FOCUS_RIGHT}.");
                    }
                }
            }
            if (rect2.right < rect.left || rect2.left > rect.right) {
                z = false;
            }
            return z;
        }
        if (rect2.bottom < rect.top || rect2.top > rect.bottom) {
            z = false;
        }
        return z;
    }

    public static boolean C0(Rect rect, Rect rect2, int i) {
        boolean z = true;
        int i2;
        if (i == 17) {
            i = rect.right;
            i2 = rect2.right;
            if ((i <= i2 && rect.left < i2) || rect.left <= rect2.left) {
                z = false;
            }
            return z;
        } else if (i == 33) {
            i = rect.bottom;
            i2 = rect2.bottom;
            if ((i <= i2 && rect.top < i2) || rect.top <= rect2.top) {
                z = false;
            }
            return z;
        } else if (i == 66) {
            i = rect.left;
            i2 = rect2.left;
            if ((i >= i2 && rect.right > i2) || rect.right >= rect2.right) {
                z = false;
            }
            return z;
        } else if (i == 130) {
            i = rect.top;
            i2 = rect2.top;
            if ((i >= i2 && rect.bottom > i2) || rect.bottom >= rect2.bottom) {
                z = false;
            }
            return z;
        } else {
            throw new IllegalArgumentException("direction must be one of {FOCUS_UP, FOCUS_DOWN, FOCUS_LEFT, FOCUS_RIGHT}.");
        }
    }

    public static void D(Object obj, StringBuilder stringBuilder) {
        if (obj == null) {
            stringBuilder.append("null");
            return;
        }
        String simpleName = obj.getClass().getSimpleName();
        if (simpleName.length() <= 0) {
            simpleName = obj.getClass().getName();
            int lastIndexOf = simpleName.lastIndexOf(46);
            if (lastIndexOf > 0) {
                simpleName = simpleName.substring(lastIndexOf + 1);
            }
        }
        stringBuilder.append(simpleName);
        stringBuilder.append('{');
        stringBuilder.append(Integer.toHexString(System.identityHashCode(obj)));
    }

    public static int D0(int i, Rect rect, Rect rect2) {
        int i2;
        if (i == 17) {
            i = rect.left;
            i2 = rect2.right;
        } else if (i == 33) {
            i = rect.top;
            i2 = rect2.bottom;
        } else if (i == 66) {
            i = rect2.left;
            i2 = rect.right;
        } else if (i == 130) {
            i = rect2.top;
            i2 = rect.bottom;
        } else {
            throw new IllegalArgumentException("direction must be one of {FOCUS_UP, FOCUS_DOWN, FOCUS_LEFT, FOCUS_RIGHT}.");
        }
        return Math.max(0, i - i2);
    }

    public static long E(File file) {
        File[] listFiles = file.listFiles();
        long j = 0;
        if (listFiles == null) {
            return 0;
        }
        for (File file2 : listFiles) {
            long E;
            if (file2.isDirectory()) {
                E = E(file2);
            } else {
                E = file2.length();
            }
            j = E + j;
        }
        return j;
    }

    public static int E0(int i, Rect rect, Rect rect2) {
        if (i != 17) {
            if (i != 33) {
                if (i != 66) {
                    if (i != 130) {
                        throw new IllegalArgumentException("direction must be one of {FOCUS_UP, FOCUS_DOWN, FOCUS_LEFT, FOCUS_RIGHT}.");
                    }
                }
            }
            return Math.abs(((rect.width() / 2) + rect.left) - ((rect2.width() / 2) + rect2.left));
        }
        return Math.abs(((rect.height() / 2) + rect.top) - ((rect2.height() / 2) + rect2.top));
    }

    public static c F(String str) {
        try {
            JSONObject jSONObject = new JSONObject(z(str));
            c cVar = new c();
            cVar.a = jSONObject.optString(HwPayConstant.KEY_URL);
            cVar.b = jSONObject.optJSONObject("body");
            jSONObject.optString("dump_file");
            cVar.c = jSONObject.optBoolean("encrypt", false);
            return cVar;
        } catch (Throwable unused) {
            return null;
        }
    }

    public static ByteBuffer F0(Context context, CancellationSignal cancellationSignal, Uri uri) {
        try {
            ParcelFileDescriptor openFileDescriptor = context.getContentResolver().openFileDescriptor(uri, "r", cancellationSignal);
            if (openFileDescriptor == null) {
                if (openFileDescriptor != null) {
                    openFileDescriptor.close();
                }
                return null;
            }
            FileInputStream fileInputStream;
            try {
                fileInputStream = new FileInputStream(openFileDescriptor.getFileDescriptor());
                FileChannel channel = fileInputStream.getChannel();
                MappedByteBuffer map = channel.map(MapMode.READ_ONLY, 0, channel.size());
                fileInputStream.close();
                openFileDescriptor.close();
                return map;
            } catch (Throwable th) {
                openFileDescriptor.close();
            }
        } catch (IOException unused) {
            return null;
        } catch (Throwable th2) {
            th.addSuppressed(th2);
        }
    }

    @SuppressLint({"SdCardPath"})
    public static String G(Context context) {
        try {
            String path;
            if (context.getFilesDir() != null) {
                path = context.getFilesDir().getPath();
            } else {
                StringBuilder stringBuilder = new StringBuilder();
                stringBuilder.append("/data/data/");
                stringBuilder.append(context.getPackageName());
                stringBuilder.append("/files/");
                File dir = context.getDir(stringBuilder.toString(), 0);
                path = dir != null ? dir.getPath() : null;
            }
            if (path != null) {
                return path;
            }
        } catch (Exception e) {
            e.printStackTrace();
        }
        return "/sdcard/";
    }

    public static <T> ObjectAnimator G0(T t, Property<T, PointF> property, Path path) {
        return ObjectAnimator.ofObject(t, property, null, path);
    }

    public static boolean H(String str) {
        return A(str) || str.equals("OPTIONS") || str.equals("DELETE") || str.equals("PROPFIND") || str.equals("MKCOL") || str.equals("LOCK");
    }

    /* JADX WARNING: Removed duplicated region for block: B:54:0x011f  */
    /* JADX WARNING: Removed duplicated region for block: B:6:0x000f  */
    public static b.i.c.b.b H0(org.xmlpull.v1.XmlPullParser r23, android.content.res.Resources r24) throws org.xmlpull.v1.XmlPullParserException, java.io.IOException {
        /*
        r0 = r24;
    L_0x0002:
        r1 = r23.next();
        r2 = 2;
        r3 = 1;
        if (r1 == r2) goto L_0x000d;
    L_0x000a:
        if (r1 == r3) goto L_0x000d;
    L_0x000c:
        goto L_0x0002;
    L_0x000d:
        if (r1 != r2) goto L_0x011f;
    L_0x000f:
        r1 = 0;
        r4 = "font-family";
        r5 = r23;
        r5.require(r2, r1, r4);
        r6 = r23.getName();
        r4 = r6.equals(r4);
        if (r4 == 0) goto L_0x011b;
    L_0x0021:
        r4 = android.util.Xml.asAttributeSet(r23);
        r6 = b.i.a.b;
        r4 = r0.obtainAttributes(r4, r6);
        r6 = 0;
        r7 = r4.getString(r6);
        r8 = 4;
        r9 = r4.getString(r8);
        r10 = 5;
        r11 = r4.getString(r10);
        r12 = r4.getResourceId(r3, r6);
        r13 = r4.getInteger(r2, r3);
        r14 = 500; // 0x1f4 float:7.0E-43 double:2.47E-321;
        r15 = 3;
        r14 = r4.getInteger(r15, r14);
        r4.recycle();
        if (r7 == 0) goto L_0x006c;
    L_0x004e:
        if (r9 == 0) goto L_0x006c;
    L_0x0050:
        if (r11 == 0) goto L_0x006c;
    L_0x0052:
        r1 = r23.next();
        if (r1 == r15) goto L_0x005c;
    L_0x0058:
        g1(r23);
        goto L_0x0052;
    L_0x005c:
        r0 = P0(r0, r12);
        r1 = new b.i.c.b.e;
        r2 = new b.i.h.a;
        r2.m488init(r7, r9, r11, r0);
        r1.m5051init(r2, r13, r14);
        goto L_0x011e;
    L_0x006c:
        r4 = new java.util.ArrayList;
        r4.<init>();
    L_0x0071:
        r7 = r23.next();
        if (r7 == r15) goto L_0x0102;
    L_0x0077:
        r7 = r23.getEventType();
        if (r7 == r2) goto L_0x007e;
    L_0x007d:
        goto L_0x0071;
    L_0x007e:
        r7 = r23.getName();
        r9 = "font";
        r7 = r7.equals(r9);
        if (r7 == 0) goto L_0x00fd;
    L_0x008a:
        r7 = android.util.Xml.asAttributeSet(r23);
        r9 = b.i.a.c;
        r7 = r0.obtainAttributes(r7, r9);
        r9 = 8;
        r11 = r7.hasValue(r9);
        if (r11 == 0) goto L_0x009d;
    L_0x009c:
        goto L_0x009e;
    L_0x009d:
        r9 = 1;
    L_0x009e:
        r11 = 400; // 0x190 float:5.6E-43 double:1.976E-321;
        r18 = r7.getInt(r9, r11);
        r9 = 6;
        r11 = r7.hasValue(r9);
        if (r11 == 0) goto L_0x00ac;
    L_0x00ab:
        goto L_0x00ad;
    L_0x00ac:
        r9 = 2;
    L_0x00ad:
        r9 = r7.getInt(r9, r6);
        if (r3 != r9) goto L_0x00b6;
    L_0x00b3:
        r19 = 1;
        goto L_0x00b8;
    L_0x00b6:
        r19 = 0;
    L_0x00b8:
        r9 = 9;
        r11 = r7.hasValue(r9);
        if (r11 == 0) goto L_0x00c1;
    L_0x00c0:
        goto L_0x00c2;
    L_0x00c1:
        r9 = 3;
    L_0x00c2:
        r11 = 7;
        r12 = r7.hasValue(r11);
        if (r12 == 0) goto L_0x00ca;
    L_0x00c9:
        goto L_0x00cb;
    L_0x00ca:
        r11 = 4;
    L_0x00cb:
        r20 = r7.getString(r11);
        r21 = r7.getInt(r9, r6);
        r9 = r7.hasValue(r10);
        if (r9 == 0) goto L_0x00db;
    L_0x00d9:
        r9 = 5;
        goto L_0x00dc;
    L_0x00db:
        r9 = 0;
    L_0x00dc:
        r22 = r7.getResourceId(r9, r6);
        r17 = r7.getString(r9);
        r7.recycle();
    L_0x00e7:
        r7 = r23.next();
        if (r7 == r15) goto L_0x00f1;
    L_0x00ed:
        g1(r23);
        goto L_0x00e7;
    L_0x00f1:
        r7 = new b.i.c.b.d;
        r16 = r7;
        r16.m464init(r17, r18, r19, r20, r21, r22);
        r4.add(r7);
        goto L_0x0071;
    L_0x00fd:
        g1(r23);
        goto L_0x0071;
    L_0x0102:
        r0 = r4.isEmpty();
        if (r0 == 0) goto L_0x0109;
    L_0x0108:
        goto L_0x011e;
    L_0x0109:
        r1 = new b.i.c.b.c;
        r0 = r4.size();
        r0 = new b.i.c.b.d[r0];
        r0 = r4.toArray(r0);
        r0 = (b.i.c.b.d[]) r0;
        r1.m5050init(r0);
        goto L_0x011e;
    L_0x011b:
        g1(r23);
    L_0x011e:
        return r1;
    L_0x011f:
        r0 = new org.xmlpull.v1.XmlPullParserException;
        r1 = "No start tag found";
        r0.<init>(r1);
        throw r0;
        */
        throw new UnsupportedOperationException("Method not decompiled: b.i.b.f.H0(org.xmlpull.v1.XmlPullParser, android.content.res.Resources):b.i.c.b.b");
    }

    public static boolean I(b.i.d.c[] cVarArr, b.i.d.c[] cVarArr2) {
        if (cVarArr == null || cVarArr2 == null || cVarArr.length != cVarArr2.length) {
            return false;
        }
        int i = 0;
        while (i < cVarArr.length) {
            if (cVarArr[i].a != cVarArr2[i].a || cVarArr[i].b.length != cVarArr2[i].b.length) {
                return false;
            }
            i++;
        }
        return true;
    }

    public static <T> List<c.a.a.f0.a<T>> I0(c.a.a.d0.h0.c cVar, c.a.a.f fVar, g0<T> g0Var) throws IOException {
        return q.a(cVar, fVar, 1.0f, g0Var);
    }

    public static void J(boolean z) {
        if (!z) {
            throw new IllegalArgumentException();
        }
    }

    public static c.a.a.b0.j.a J0(c.a.a.d0.h0.c cVar, c.a.a.f fVar) throws IOException {
        return new c.a.a.b0.j.a(I0(cVar, fVar, e.a));
    }

    public static void K(boolean z, Object obj) {
        if (!z) {
            throw new IllegalArgumentException(String.valueOf(obj));
        }
    }

    public static b K0(c.a.a.d0.h0.c cVar, c.a.a.f fVar) throws IOException {
        return L0(cVar, fVar, true);
    }

    public static int L(int i) {
        if (i >= 0) {
            return i;
        }
        throw new IllegalArgumentException();
    }

    public static b L0(c.a.a.d0.h0.c cVar, c.a.a.f fVar, boolean z) throws IOException {
        return new b(q.a(cVar, fVar, z ? g.c() : 1.0f, h.a));
    }

    public static void M(String str) {
        if ((Looper.getMainLooper() == Looper.myLooper() ? 1 : null) == null) {
            throw new IllegalStateException(str);
        }
    }

    public static d M0(c.a.a.d0.h0.c cVar, c.a.a.f fVar) throws IOException {
        return new d(I0(cVar, fVar, n.a));
    }

    public static String N(String str) {
        if (!TextUtils.isEmpty(str)) {
            return str;
        }
        throw new IllegalArgumentException("Given String is empty or null");
    }

    public static c.a.a.b0.j.f N0(c.a.a.d0.h0.c cVar, c.a.a.f fVar) throws IOException {
        return new c.a.a.b0.j.f(q.a(cVar, fVar, g.c(), v.a));
    }

    public static String O(String str, Object obj) {
        if (!TextUtils.isEmpty(str)) {
            return str;
        }
        throw new IllegalArgumentException(String.valueOf(obj));
    }

    public static boolean O0(Parcel parcel, int i) {
        s1(parcel, i, 4);
        return parcel.readInt() != 0;
    }

    public static void P(String str) {
        if ((Looper.getMainLooper() == Looper.myLooper() ? 1 : null) != null) {
            throw new IllegalStateException(str);
        }
    }

    public static List<List<byte[]>> P0(Resources resources, int i) {
        if (i == 0) {
            return Collections.emptyList();
        }
        TypedArray obtainTypedArray = resources.obtainTypedArray(i);
        try {
            if (obtainTypedArray.length() == 0) {
                List<List<byte[]>> emptyList = Collections.emptyList();
                return emptyList;
            }
            ArrayList arrayList = new ArrayList();
            if (obtainTypedArray.getType(0) == 1) {
                for (i = 0; i < obtainTypedArray.length(); i++) {
                    int resourceId = obtainTypedArray.getResourceId(i, 0);
                    if (resourceId != 0) {
                        arrayList.add(i1(resources.getStringArray(resourceId)));
                    }
                }
            } else {
                arrayList.add(i1(resources.getStringArray(i)));
            }
            obtainTypedArray.recycle();
            return arrayList;
        } finally {
            obtainTypedArray.recycle();
        }
    }

    public static <T> T Q(T t, Object obj) {
        if (t != null) {
            return t;
        }
        throw new NullPointerException(String.valueOf(obj));
    }

    public static IBinder Q0(Parcel parcel, int i) {
        i = T0(parcel, i);
        int dataPosition = parcel.dataPosition();
        if (i == 0) {
            return null;
        }
        IBinder readStrongBinder = parcel.readStrongBinder();
        parcel.setDataPosition(dataPosition + i);
        return readStrongBinder;
    }

    public static <T> T R(T t) {
        Objects.requireNonNull(t, "null reference");
        return t;
    }

    public static int R0(Parcel parcel, int i) {
        s1(parcel, i, 4);
        return parcel.readInt();
    }

    public static <T> T S(T t, Object obj) {
        if (t != null) {
            return t;
        }
        throw new NullPointerException(String.valueOf(obj));
    }

    public static long S0(Parcel parcel, int i) {
        s1(parcel, i, 8);
        return parcel.readLong();
    }

    public static int T(Context context, String str) {
        int myPid = Process.myPid();
        int myUid = Process.myUid();
        String packageName = context.getPackageName();
        if (context.checkPermission(str, myPid, myUid) == -1) {
            return -1;
        }
        myPid = VERSION.SDK_INT;
        str = myPid >= 23 ? AppOpsManager.permissionToOp(str) : null;
        if (str != null) {
            if (packageName == null) {
                String[] packagesForUid = context.getPackageManager().getPackagesForUid(myUid);
                if (packagesForUid == null || packagesForUid.length <= 0) {
                    return -1;
                }
                packageName = packagesForUid[0];
            }
            if ((myPid >= 23 ? ((AppOpsManager) context.getSystemService(AppOpsManager.class)).noteProxyOpNoThrow(str, packageName) : 1) != 0) {
                return -2;
            }
        }
        return 0;
    }

    public static int T0(Parcel parcel, int i) {
        return (i & -65536) != -65536 ? (i >> 16) & 65535 : parcel.readInt();
    }

    public static void U(boolean z, Object obj) {
        if (!z) {
            throw new IllegalStateException(String.valueOf(obj));
        }
    }

    public static <TInput, TResult, TException extends Throwable> TResult U0(int i, TInput tInput, c.e.a.a.e.c<TInput, TResult, TException> cVar, c.e.a.a.f.o.a<TInput, TResult> aVar) throws Throwable {
        if (i < 1) {
            return cVar.a(tInput);
        }
        Object a;
        do {
            Object tInput2;
            a = cVar.a(tInput2);
            c.e.a.a.e.e.a aVar2 = (c.e.a.a.e.e.a) tInput2;
            c.e.a.a.e.e.b bVar = (c.e.a.a.e.e.b) a;
            URL url = bVar.b;
            if (url != null) {
                m0("CctTransportBackend", "Following redirect to: %s", url);
                tInput2 = new c.e.a.a.e.e.a(bVar.b, aVar2.b, aVar2.c);
            } else {
                tInput2 = null;
            }
            if (tInput2 == null) {
                break;
            }
            i--;
        } while (i >= 1);
        return a;
    }

    public static int V(int i, int i2, int i3) {
        return i < i2 ? i2 : i > i3 ? i3 : i;
    }

    public static void V0(TextView textView, int i) {
        L(i);
        if (VERSION.SDK_INT >= 28) {
            textView.setFirstBaselineToTopHeight(i);
            return;
        }
        int i2;
        FontMetricsInt fontMetricsInt = textView.getPaint().getFontMetricsInt();
        if (textView.getIncludeFontPadding()) {
            i2 = fontMetricsInt.top;
        } else {
            i2 = fontMetricsInt.ascent;
        }
        if (i > Math.abs(i2)) {
            textView.setPadding(textView.getPaddingLeft(), i + i2, textView.getPaddingRight(), textView.getPaddingBottom());
        }
    }

    public static void W(Drawable drawable) {
        if (VERSION.SDK_INT >= 23) {
            drawable.clearColorFilter();
            return;
        }
        drawable.clearColorFilter();
        if (drawable instanceof InsetDrawable) {
            W(((InsetDrawable) drawable).getDrawable());
        } else if (drawable instanceof b.i.d.l.b) {
            W(((b.i.d.l.b) drawable).b());
        } else if (drawable instanceof DrawableContainer) {
            DrawableContainerState drawableContainerState = (DrawableContainerState) ((DrawableContainer) drawable).getConstantState();
            if (drawableContainerState != null) {
                int childCount = drawableContainerState.getChildCount();
                for (int i = 0; i < childCount; i++) {
                    Drawable child = drawableContainerState.getChild(i);
                    if (child != null) {
                        W(child);
                    }
                }
            }
        }
    }

    public static void W0(TextView textView, int i) {
        int i2;
        L(i);
        FontMetricsInt fontMetricsInt = textView.getPaint().getFontMetricsInt();
        if (textView.getIncludeFontPadding()) {
            i2 = fontMetricsInt.bottom;
        } else {
            i2 = fontMetricsInt.descent;
        }
        if (i > Math.abs(i2)) {
            textView.setPadding(textView.getPaddingLeft(), textView.getPaddingTop(), textView.getPaddingRight(), i - i2);
        }
    }

    public static int X(w wVar, z zVar, View view, View view2, m mVar, boolean z) {
        if (mVar.A() == 0 || wVar.b() == 0 || view == null || view2 == null) {
            return 0;
        }
        if (!z) {
            return Math.abs(mVar.S(view) - mVar.S(view2)) + 1;
        }
        return Math.min(zVar.l(), zVar.b(view2) - zVar.e(view));
    }

    public static boolean X0(Drawable drawable, int i) {
        if (VERSION.SDK_INT >= 23) {
            return drawable.setLayoutDirection(i);
        }
        Method declaredMethod;
        String str = "DrawableCompat";
        if (!b) {
            try {
                declaredMethod = Drawable.class.getDeclaredMethod("setLayoutDirection", new Class[]{Integer.TYPE});
                a = declaredMethod;
                declaredMethod.setAccessible(true);
            } catch (NoSuchMethodException e) {
                Log.i(str, "Failed to retrieve setLayoutDirection(int) method", e);
            }
            b = true;
        }
        declaredMethod = a;
        if (declaredMethod != null) {
            try {
                declaredMethod.invoke(drawable, new Object[]{Integer.valueOf(i)});
                return true;
            } catch (Exception e2) {
                Log.i(str, "Failed to invoke setLayoutDirection(int) via reflection", e2);
                a = null;
            }
        }
        return false;
    }

    public static int Y(w wVar, z zVar, View view, View view2, m mVar, boolean z, boolean z2) {
        if (mVar.A() == 0 || wVar.b() == 0 || view == null || view2 == null) {
            return 0;
        }
        int max;
        int min = Math.min(mVar.S(view), mVar.S(view2));
        int max2 = Math.max(mVar.S(view), mVar.S(view2));
        if (z2) {
            max = Math.max(0, (wVar.b() - max2) - 1);
        } else {
            max = Math.max(0, min);
        }
        if (!z) {
            return max;
        }
        return Math.round((((float) max) * (((float) Math.abs(zVar.b(view2) - zVar.e(view))) / ((float) (Math.abs(mVar.S(view) - mVar.S(view2)) + 1)))) + ((float) (zVar.k() - zVar.e(view))));
    }

    public static void Y0(TextView textView, int i) {
        L(i);
        int fontMetricsInt = textView.getPaint().getFontMetricsInt(null);
        if (i != fontMetricsInt) {
            textView.setLineSpacing((float) (i - fontMetricsInt), 1.0f);
        }
    }

    public static int Z(w wVar, z zVar, View view, View view2, m mVar, boolean z) {
        if (mVar.A() == 0 || wVar.b() == 0 || view == null || view2 == null) {
            return 0;
        }
        if (!z) {
            return wVar.b();
        }
        return (int) ((((float) (zVar.b(view2) - zVar.e(view))) / ((float) (Math.abs(mVar.S(view) - mVar.S(view2)) + 1))) * ((float) wVar.b()));
    }

    public static void Z0(PopupWindow popupWindow, boolean z) {
        if (VERSION.SDK_INT >= 23) {
            popupWindow.setOverlapAnchor(z);
            return;
        }
        String str = "PopupWindowCompatApi21";
        if (!j) {
            try {
                Field declaredField = PopupWindow.class.getDeclaredField("mOverlapAnchor");
                i = declaredField;
                declaredField.setAccessible(true);
            } catch (NoSuchFieldException e) {
                Log.i(str, "Could not fetch mOverlapAnchor field from PopupWindow", e);
            }
            j = true;
        }
        Field field = i;
        if (field != null) {
            try {
                field.set(popupWindow, Boolean.valueOf(z));
            } catch (IllegalAccessException e2) {
                Log.i(str, "Could not set overlap anchor field in PopupWindow", e2);
            }
        }
    }

    public static float a(float f) {
        return f <= 0.04045f ? f / 12.92f : (float) Math.pow((double) ((f + 0.055f) / 1.055f), 2.4000000953674316d);
    }

    public static float[] a0(float[] fArr, int i, int i2) {
        if (i <= i2) {
            int length = fArr.length;
            if (i < 0 || i > length) {
                throw new ArrayIndexOutOfBoundsException();
            }
            i2 -= i;
            length = Math.min(i2, length - i);
            float[] fArr2 = new float[i2];
            System.arraycopy(fArr, i, fArr2, 0, length);
            return fArr2;
        }
        throw new IllegalArgumentException();
    }

    public static void a1(TextView textView, b.i.i.b bVar) {
        if (VERSION.SDK_INT >= 29) {
            Objects.requireNonNull(bVar);
            textView.setText(null);
            return;
        }
        a A0 = A0(textView);
        Objects.requireNonNull(bVar);
        if (A0.a(null)) {
            textView.setText(bVar);
            return;
        }
        throw new IllegalArgumentException("Given text can not be applied to TextView.");
    }

    public static float b(float f) {
        return f <= 0.0031308f ? f * 12.92f : (float) ((Math.pow((double) f, 0.4166666567325592d) * 1.0549999475479126d) - 0.054999999701976776d);
    }

    /* JADX WARNING: Removed duplicated region for block: B:13:0x0014 A:{SYNTHETIC, Splitter:B:13:0x0014} */
    public static boolean b0(java.io.File r0, android.content.res.Resources r1, int r2) {
        /*
        r1 = r1.openRawResource(r2);	 Catch:{ all -> 0x0010 }
        r0 = c0(r0, r1);	 Catch:{ all -> 0x000e }
        if (r1 == 0) goto L_0x000d;
    L_0x000a:
        r1.close();	 Catch:{ IOException -> 0x000d }
    L_0x000d:
        return r0;
    L_0x000e:
        r0 = move-exception;
        goto L_0x0012;
    L_0x0010:
        r0 = move-exception;
        r1 = 0;
    L_0x0012:
        if (r1 == 0) goto L_0x0017;
    L_0x0014:
        r1.close();	 Catch:{ IOException -> 0x0017 }
    L_0x0017:
        throw r0;
        */
        throw new UnsupportedOperationException("Method not decompiled: b.i.b.f.b0(java.io.File, android.content.res.Resources, int):boolean");
    }

    public static void b1(TextView textView, int i) {
        if (VERSION.SDK_INT >= 23) {
            textView.setTextAppearance(i);
        } else {
            textView.setTextAppearance(textView.getContext(), i);
        }
    }

    public static long c(String str) {
        try {
            SimpleDateFormat simpleDateFormat = new SimpleDateFormat("EEE, dd MMM yyyy HH:mm:ss zzz", Locale.US);
            simpleDateFormat.setTimeZone(TimeZone.getTimeZone("GMT"));
            return simpleDateFormat.parse(str).getTime();
        } catch (Throwable th) {
            c.c.b.b.f.q.b(th, "Unable to parse dateStr: %s, falling back to 0", str);
            return 0;
        }
    }

    /* JADX WARNING: Removed duplicated region for block: B:25:0x0047 A:{SYNTHETIC, Splitter:B:25:0x0047} */
    /* JADX WARNING: Removed duplicated region for block: B:31:0x0050 A:{SYNTHETIC, Splitter:B:31:0x0050} */
    public static boolean c0(java.io.File r5, java.io.InputStream r6) {
        /*
        r0 = android.os.StrictMode.allowThreadDiskWrites();
        r1 = 0;
        r2 = 0;
        r3 = new java.io.FileOutputStream;	 Catch:{ IOException -> 0x002a }
        r3.<init>(r5, r1);	 Catch:{ IOException -> 0x002a }
        r5 = 1024; // 0x400 float:1.435E-42 double:5.06E-321;
        r5 = new byte[r5];	 Catch:{ IOException -> 0x0025, all -> 0x0022 }
    L_0x000f:
        r2 = r6.read(r5);	 Catch:{ IOException -> 0x0025, all -> 0x0022 }
        r4 = -1;
        if (r2 == r4) goto L_0x001a;
    L_0x0016:
        r3.write(r5, r1, r2);	 Catch:{ IOException -> 0x0025, all -> 0x0022 }
        goto L_0x000f;
    L_0x001a:
        r5 = 1;
        r3.close();	 Catch:{ IOException -> 0x001e }
    L_0x001e:
        android.os.StrictMode.setThreadPolicy(r0);
        return r5;
    L_0x0022:
        r5 = move-exception;
        r2 = r3;
        goto L_0x004e;
    L_0x0025:
        r5 = move-exception;
        r2 = r3;
        goto L_0x002b;
    L_0x0028:
        r5 = move-exception;
        goto L_0x004e;
    L_0x002a:
        r5 = move-exception;
    L_0x002b:
        r6 = "TypefaceCompatUtil";
        r3 = new java.lang.StringBuilder;	 Catch:{ all -> 0x0028 }
        r3.<init>();	 Catch:{ all -> 0x0028 }
        r4 = "Error copying resource contents to temp file: ";
        r3.append(r4);	 Catch:{ all -> 0x0028 }
        r5 = r5.getMessage();	 Catch:{ all -> 0x0028 }
        r3.append(r5);	 Catch:{ all -> 0x0028 }
        r5 = r3.toString();	 Catch:{ all -> 0x0028 }
        android.util.Log.e(r6, r5);	 Catch:{ all -> 0x0028 }
        if (r2 == 0) goto L_0x004a;
    L_0x0047:
        r2.close();	 Catch:{ IOException -> 0x004a }
    L_0x004a:
        android.os.StrictMode.setThreadPolicy(r0);
        return r1;
    L_0x004e:
        if (r2 == 0) goto L_0x0053;
    L_0x0050:
        r2.close();	 Catch:{ IOException -> 0x0053 }
    L_0x0053:
        android.os.StrictMode.setThreadPolicy(r0);
        throw r5;
        */
        throw new UnsupportedOperationException("Method not decompiled: b.i.b.f.c0(java.io.File, java.io.InputStream):boolean");
    }

    public static void c1(Drawable drawable, int i) {
        drawable.setTint(i);
    }

    public static x d(String str, String str2, boolean z, JSONObject jSONObject) {
        String str3 = null;
        if (TextUtils.isEmpty(str)) {
            if (m0.b) {
                StringBuilder stringBuilder = new StringBuilder();
                stringBuilder.append("WebViewJsUtil no event name, ignore ");
                stringBuilder.append(str);
                m0.a(stringBuilder.toString(), null);
            }
            return null;
        }
        if (jSONObject != null) {
            str3 = jSONObject.toString();
        }
        x xVar = new x(str, z, str3);
        if (!TextUtils.isEmpty(str)) {
            try {
                xVar.a = Long.parseLong(str2);
            } catch (NumberFormatException e) {
                m0.b(e);
            }
        }
        return xVar;
    }

    public static Bundle d0(Parcel parcel, int i) {
        i = T0(parcel, i);
        int dataPosition = parcel.dataPosition();
        if (i == 0) {
            return null;
        }
        Bundle readBundle = parcel.readBundle();
        parcel.setDataPosition(dataPosition + i);
        return readBundle;
    }

    public static void d1(Drawable drawable, ColorStateList colorStateList) {
        drawable.setTintList(colorStateList);
    }

    /* JADX WARNING: Removed duplicated region for block: B:78:0x011b  */
    /* JADX WARNING: Removed duplicated region for block: B:76:0x0115  */
    /* JADX WARNING: Removed duplicated region for block: B:67:0x0100 A:{Catch:{ IOException -> 0x0104 }} */
    /* JADX WARNING: Removed duplicated region for block: B:76:0x0115  */
    /* JADX WARNING: Removed duplicated region for block: B:78:0x011b  */
    public static c.c.a.d1 e(android.content.Context r8) {
        /*
        r0 = android.os.Build.MANUFACTURER;
        r1 = android.text.TextUtils.isEmpty(r0);
        r2 = 0;
        if (r1 != 0) goto L_0x0014;
    L_0x0009:
        r1 = r0.toLowerCase();
        r3 = "oppo";
        r1 = r1.contains(r3);
        goto L_0x0015;
    L_0x0014:
        r1 = 0;
    L_0x0015:
        if (r1 == 0) goto L_0x0022;
    L_0x0017:
        r8 = new c.c.a.h1;
        r0 = new c.c.a.c0;
        r0.m5221init();
        r8.m5237init(r0);
        return r8;
    L_0x0022:
        r1 = c.c.a.c0.b;
        r3 = 1;
        if (r1 == 0) goto L_0x0031;
    L_0x0027:
        r1 = c.c.a.c0.a;
        if (r1 == 0) goto L_0x0031;
    L_0x002b:
        r1 = c.c.a.c0.c;
        if (r1 == 0) goto L_0x0031;
    L_0x002f:
        r1 = 1;
        goto L_0x0032;
    L_0x0031:
        r1 = 0;
    L_0x0032:
        if (r1 == 0) goto L_0x003a;
    L_0x0034:
        r8 = new c.c.a.c0;
        r8.m5221init();
        return r8;
    L_0x003a:
        r1 = c.c.a.g1.c;
        r4 = new java.lang.Object[r2];
        r1 = r1.b(r4);
        r1 = (java.lang.Boolean) r1;
        r1 = r1.booleanValue();
        if (r1 == 0) goto L_0x0050;
    L_0x004a:
        r0 = new c.c.a.g1;
        r0.m5232init(r8);
        return r0;
    L_0x0050:
        r1 = c.c.a.e.a();
        r1 = r1.toUpperCase();
        r4 = "HUAWEI";
        r1 = r1.contains(r4);
        if (r1 == 0) goto L_0x0066;
    L_0x0060:
        r8 = new c.c.a.w0;
        r8.m5268init();
        return r8;
    L_0x0066:
        r1 = "OnePlus";
        r1 = r1.equalsIgnoreCase(r0);
        if (r1 == 0) goto L_0x0074;
    L_0x006e:
        r8 = new c.c.a.h1;
        r8.m5236init();
        return r8;
    L_0x0074:
        r1 = android.os.Build.BRAND;
        if (r1 != 0) goto L_0x007a;
    L_0x0078:
        r4 = 0;
        goto L_0x0086;
    L_0x007a:
        r4 = java.util.Locale.ENGLISH;
        r4 = r1.toLowerCase(r4);
        r5 = "meizu";
        r4 = r4.contains(r5);
    L_0x0086:
        if (r4 == 0) goto L_0x008e;
    L_0x0088:
        r8 = new c.c.a.a1;
        r8.m5215init();
        return r8;
    L_0x008e:
        r4 = android.os.Build.VERSION.SDK_INT;
        r5 = 28;
        r6 = 0;
        if (r4 <= r5) goto L_0x0137;
    L_0x0095:
        r8 = "samsung";
        r1 = r8.equalsIgnoreCase(r1);
        if (r1 != 0) goto L_0x00a6;
    L_0x009d:
        r8 = r8.equalsIgnoreCase(r0);
        if (r8 == 0) goto L_0x00a4;
    L_0x00a3:
        goto L_0x00a6;
    L_0x00a4:
        r8 = 0;
        goto L_0x00a7;
    L_0x00a6:
        r8 = 1;
    L_0x00a7:
        if (r8 == 0) goto L_0x00af;
    L_0x00a9:
        r8 = new c.c.a.j1;
        r8.m7910init();
        return r8;
    L_0x00af:
        r8 = c.c.a.e.a();
        r8 = r8.toUpperCase();
        r0 = "NUBIA";
        r8 = r8.contains(r0);
        if (r8 == 0) goto L_0x00c5;
    L_0x00bf:
        r8 = new c.c.a.b1;
        r8.m5219init();
        return r8;
    L_0x00c5:
        r8 = android.os.Build.FINGERPRINT;
        r0 = android.text.TextUtils.isEmpty(r8);
        r1 = "VIBEUI_V2";
        if (r0 != 0) goto L_0x00d4;
    L_0x00cf:
        r8 = r8.contains(r1);
        goto L_0x0113;
    L_0x00d4:
        r8 = "";
        r0 = java.lang.Runtime.getRuntime();	 Catch:{ all -> 0x00fd }
        r4 = "getprop ro.build.version.incremental";
        r0 = r0.exec(r4);	 Catch:{ all -> 0x00fd }
        r4 = new java.io.BufferedReader;	 Catch:{ all -> 0x00fd }
        r5 = new java.io.InputStreamReader;	 Catch:{ all -> 0x00fd }
        r7 = r0.getInputStream();	 Catch:{ all -> 0x00fd }
        r5.<init>(r7);	 Catch:{ all -> 0x00fd }
        r7 = 1024; // 0x400 float:1.435E-42 double:5.06E-321;
        r4.<init>(r5, r7);	 Catch:{ all -> 0x00fd }
        r8 = r4.readLine();	 Catch:{ all -> 0x00fb }
        r0.destroy();	 Catch:{ all -> 0x00fb }
        r4.close();	 Catch:{ IOException -> 0x0104 }
        goto L_0x0105;
    L_0x00fb:
        r6 = r4;
        goto L_0x00fe;
    L_0x00fe:
        if (r6 == 0) goto L_0x0105;
    L_0x0100:
        r6.close();	 Catch:{ IOException -> 0x0104 }
        goto L_0x0105;
    L_0x0105:
        r0 = android.text.TextUtils.isEmpty(r8);
        if (r0 != 0) goto L_0x0112;
    L_0x010b:
        r8 = r8.contains(r1);
        if (r8 == 0) goto L_0x0112;
    L_0x0111:
        r2 = 1;
    L_0x0112:
        r8 = r2;
    L_0x0113:
        if (r8 == 0) goto L_0x011b;
    L_0x0115:
        r8 = new c.c.a.z0;
        r8.m7916init();
        return r8;
    L_0x011b:
        r8 = c.c.a.e.a();
        r8 = r8.toUpperCase();
        r0 = "ASUS";
        r8 = r8.contains(r0);
        if (r8 == 0) goto L_0x0131;
    L_0x012b:
        r8 = new c.c.a.f0;
        r8.m7909init();
        return r8;
    L_0x0131:
        r8 = new c.c.a.s0;
        r8.m7911init();
        return r8;
    L_0x0137:
        r0 = "miui.os.Build";
        r0 = java.lang.Class.forName(r0);	 Catch:{ Exception -> 0x0149 }
        r0 = r0.getName();	 Catch:{ Exception -> 0x0149 }
        r0 = r0.length();	 Catch:{ Exception -> 0x0149 }
        if (r0 <= 0) goto L_0x014a;
    L_0x0147:
        r2 = 1;
        goto L_0x014a;
    L_0x014a:
        if (r2 != 0) goto L_0x0158;
    L_0x014c:
        r8 = c.c.a.w0.c(r8);
        if (r8 == 0) goto L_0x0158;
    L_0x0152:
        r8 = new c.c.a.w0;
        r8.m5268init();
        return r8;
    L_0x0158:
        return r6;
        */
        throw new UnsupportedOperationException("Method not decompiled: b.i.b.f.e(android.content.Context):c.c.a.d1");
    }

    /* JADX WARNING: Removed duplicated region for block: B:9:0x0016  */
    /* JADX WARNING: Removed duplicated region for block: B:7:0x0011  */
    public static android.content.res.ColorStateList e0(android.content.res.Resources r4, org.xmlpull.v1.XmlPullParser r5, android.content.res.Resources.Theme r6) throws org.xmlpull.v1.XmlPullParserException, java.io.IOException {
        /*
        r0 = android.util.Xml.asAttributeSet(r5);
    L_0x0004:
        r1 = r5.next();
        r2 = 2;
        if (r1 == r2) goto L_0x000f;
    L_0x000b:
        r3 = 1;
        if (r1 == r3) goto L_0x000f;
    L_0x000e:
        goto L_0x0004;
    L_0x000f:
        if (r1 != r2) goto L_0x0016;
    L_0x0011:
        r4 = f0(r4, r5, r0, r6);
        return r4;
    L_0x0016:
        r4 = new org.xmlpull.v1.XmlPullParserException;
        r5 = "No start tag found";
        r4.<init>(r5);
        throw r4;
        */
        throw new UnsupportedOperationException("Method not decompiled: b.i.b.f.e0(android.content.res.Resources, org.xmlpull.v1.XmlPullParser, android.content.res.Resources$Theme):android.content.res.ColorStateList");
    }

    public static void e1(Drawable drawable, Mode mode) {
        drawable.setTintMode(mode);
    }

    public static c.c.b.b.i.b.a f(c.c.b.b.f.m mVar) {
        long j;
        long j2;
        Object obj;
        long j3;
        c.c.b.b.f.m mVar2 = mVar;
        long currentTimeMillis = System.currentTimeMillis();
        Map map = mVar2.c;
        String str = (String) map.get("Date");
        long c = str != null ? c(str) : 0;
        str = (String) map.get("Cache-Control");
        int i = 0;
        if (str != null) {
            String[] split = str.split(",", 0);
            int i2 = 0;
            j = 0;
            j2 = 0;
            while (i < split.length) {
                String trim = split[i].trim();
                if (trim.equals("no-cache") || trim.equals("no-store")) {
                    return null;
                }
                if (trim.startsWith("max-age=")) {
                    try {
                        j = Long.parseLong(trim.substring(8));
                    } catch (Exception unused) {
                    }
                } else if (trim.startsWith("stale-while-revalidate=")) {
                    j2 = Long.parseLong(trim.substring(23));
                } else if (trim.equals("must-revalidate") || trim.equals("proxy-revalidate")) {
                    i2 = 1;
                }
                i++;
            }
            i = i2;
            obj = 1;
        } else {
            obj = null;
            j = 0;
            j2 = 0;
        }
        str = (String) map.get("Expires");
        long c2 = str != null ? c(str) : 0;
        String str2 = (String) map.get("Last-Modified");
        long c3 = str2 != null ? c(str2) : 0;
        str2 = (String) map.get("ETag");
        if (obj != null) {
            currentTimeMillis += j * 1000;
            if (i != 0) {
                j2 = currentTimeMillis;
            } else {
                Long.signum(j2);
                j2 = (j2 * 1000) + currentTimeMillis;
            }
            j3 = j2;
        } else {
            j3 = 0;
            if (c <= 0 || c2 < c) {
                currentTimeMillis = 0;
            } else {
                currentTimeMillis += c2 - c;
                j3 = currentTimeMillis;
            }
        }
        c.c.b.b.i.b.a aVar = new c.c.b.b.i.b.a();
        aVar.a = mVar2.a;
        aVar.b = mVar2.b;
        aVar.c = str2;
        aVar.g = currentTimeMillis;
        aVar.f = j3;
        aVar.d = c;
        aVar.e = c3;
        aVar.h = map;
        aVar.i = mVar2.d;
        return aVar;
    }

    public static ColorStateList f0(Resources resources, XmlPullParser xmlPullParser, AttributeSet attributeSet, Theme theme) throws XmlPullParserException, IOException {
        AttributeSet attributeSet2 = attributeSet;
        Theme theme2 = theme;
        String name = xmlPullParser.getName();
        if (name.equals("selector")) {
            int i = 1;
            int depth = xmlPullParser.getDepth() + 1;
            Object obj = new int[20][];
            Object obj2 = new int[20];
            int i2 = 0;
            while (true) {
                int next = xmlPullParser.next();
                if (next == i) {
                    break;
                }
                int depth2 = xmlPullParser.getDepth();
                if (depth2 < depth && next == 3) {
                    break;
                }
                Resources resources2;
                if (next == 2 && depth2 <= depth && xmlPullParser.getName().equals("item")) {
                    TypedArray obtainAttributes;
                    int i3;
                    int[] iArr = b.i.a.a;
                    if (theme2 == null) {
                        obtainAttributes = resources.obtainAttributes(attributeSet2, iArr);
                    } else {
                        resources2 = resources;
                        obtainAttributes = theme2.obtainStyledAttributes(attributeSet2, iArr, 0, 0);
                    }
                    int color = obtainAttributes.getColor(0, -65281);
                    float f = 1.0f;
                    if (obtainAttributes.hasValue(i)) {
                        f = obtainAttributes.getFloat(i, 1.0f);
                    } else if (obtainAttributes.hasValue(2)) {
                        f = obtainAttributes.getFloat(2, 1.0f);
                    }
                    obtainAttributes.recycle();
                    next = attributeSet.getAttributeCount();
                    int[] iArr2 = new int[next];
                    int i4 = 0;
                    for (i3 = 0; i3 < next; i3++) {
                        int attributeNameResource = attributeSet2.getAttributeNameResource(i3);
                        if (!(attributeNameResource == 16843173 || attributeNameResource == 16843551 || attributeNameResource == 2130968616)) {
                            i = i4 + 1;
                            if (!attributeSet2.getAttributeBooleanValue(i3, false)) {
                                attributeNameResource = -attributeNameResource;
                            }
                            iArr2[i4] = attributeNameResource;
                            i4 = i;
                        }
                    }
                    int[] trimStateSet = StateSet.trimStateSet(iArr2, i4);
                    next = (Math.round(((float) Color.alpha(color)) * f) << 24) | (16777215 & color);
                    int i5 = i2 + 1;
                    i3 = 8;
                    if (i5 > obj2.length) {
                        Object obj3 = new int[(i2 <= 4 ? 8 : i2 * 2)];
                        System.arraycopy(obj2, 0, obj3, 0, i2);
                        obj2 = obj3;
                    }
                    obj2[i2] = next;
                    if (i5 > obj.length) {
                        Class componentType = obj.getClass().getComponentType();
                        if (i2 > 4) {
                            i3 = i2 * 2;
                        }
                        Object obj4 = (Object[]) Array.newInstance(componentType, i3);
                        System.arraycopy(obj, 0, obj4, 0, i2);
                        obj = obj4;
                    }
                    obj[i2] = trimStateSet;
                    obj = (int[][]) obj;
                    i2 = i5;
                } else {
                    resources2 = resources;
                }
                i = 1;
            }
            int[] iArr3 = new int[i2];
            int[][] iArr4 = new int[i2][];
            System.arraycopy(obj2, 0, iArr3, 0, i2);
            System.arraycopy(obj, 0, iArr4, 0, i2);
            return new ColorStateList(iArr4, iArr3);
        }
        StringBuilder stringBuilder = new StringBuilder();
        stringBuilder.append(xmlPullParser.getPositionDescription());
        stringBuilder.append(": invalid color state list tag ");
        stringBuilder.append(name);
        throw new XmlPullParserException(stringBuilder.toString());
    }

    public static void f1(PopupWindow popupWindow, int i) {
        if (VERSION.SDK_INT >= 23) {
            popupWindow.setWindowLayoutType(i);
            return;
        }
        Method declaredMethod;
        if (!h) {
            try {
                declaredMethod = PopupWindow.class.getDeclaredMethod("setWindowLayoutType", new Class[]{Integer.TYPE});
                g = declaredMethod;
                declaredMethod.setAccessible(true);
            } catch (Exception unused) {
            }
            h = true;
        }
        declaredMethod = g;
        if (declaredMethod != null) {
            try {
                declaredMethod.invoke(popupWindow, new Object[]{Integer.valueOf(i)});
            } catch (Exception unused2) {
            }
        }
    }

    public static File g(Context context) {
        return new File(G(context), "CrashLogJava");
    }

    /* JADX WARNING: Removed duplicated region for block: B:46:0x0098 A:{LOOP_END, LOOP:3: B:26:0x006d->B:46:0x0098, Catch:{ NumberFormatException -> 0x00ba }} */
    /* JADX WARNING: Removed duplicated region for block: B:80:0x0097 A:{SYNTHETIC} */
    /* JADX WARNING: Removed duplicated region for block: B:48:0x009d A:{Catch:{ NumberFormatException -> 0x00ba }} */
    /* JADX WARNING: Removed duplicated region for block: B:51:0x00ad A:{Catch:{ NumberFormatException -> 0x00ba }} */
    /* JADX WARNING: Removed duplicated region for block: B:50:0x00ac A:{Catch:{ NumberFormatException -> 0x00ba }} */
    /* JADX WARNING: Removed duplicated region for block: B:70:0x00d7 A:{SYNTHETIC} */
    /* JADX WARNING: Removed duplicated region for block: B:18:0x0048  */
    /* JADX WARNING: Missing block: B:38:0x008b, code skipped:
            if (r13 == null) goto L_0x008d;
     */
    /* JADX WARNING: Missing block: B:39:0x008d, code skipped:
            r11 = 1;
     */
    public static b.i.d.c[] g0(java.lang.String r16) {
        /*
        r0 = r16;
        if (r0 != 0) goto L_0x0006;
    L_0x0004:
        r0 = 0;
        return r0;
    L_0x0006:
        r1 = new java.util.ArrayList;
        r1.<init>();
        r2 = 0;
        r3 = 1;
        r4 = 0;
    L_0x000e:
        r5 = r16.length();
        if (r3 >= r5) goto L_0x00df;
    L_0x0014:
        r5 = r16.length();
        r6 = 69;
        r7 = 101; // 0x65 float:1.42E-43 double:5.0E-322;
        if (r3 >= r5) goto L_0x003a;
    L_0x001e:
        r5 = r0.charAt(r3);
        r8 = r5 + -65;
        r9 = r5 + -90;
        r9 = r9 * r8;
        if (r9 <= 0) goto L_0x0032;
    L_0x002a:
        r8 = r5 + -97;
        r9 = r5 + -122;
        r9 = r9 * r8;
        if (r9 > 0) goto L_0x0037;
    L_0x0032:
        if (r5 == r7) goto L_0x0037;
    L_0x0034:
        if (r5 == r6) goto L_0x0037;
    L_0x0036:
        goto L_0x003a;
    L_0x0037:
        r3 = r3 + 1;
        goto L_0x0014;
    L_0x003a:
        r4 = r0.substring(r4, r3);
        r4 = r4.trim();
        r5 = r4.length();
        if (r5 <= 0) goto L_0x00d7;
    L_0x0048:
        r5 = r4.charAt(r2);
        r8 = 122; // 0x7a float:1.71E-43 double:6.03E-322;
        if (r5 == r8) goto L_0x00c9;
    L_0x0050:
        r5 = r4.charAt(r2);
        r8 = 90;
        if (r5 != r8) goto L_0x005a;
    L_0x0058:
        goto L_0x00c9;
    L_0x005a:
        r5 = r4.length();	 Catch:{ NumberFormatException -> 0x00ba }
        r5 = new float[r5];	 Catch:{ NumberFormatException -> 0x00ba }
        r8 = r4.length();	 Catch:{ NumberFormatException -> 0x00ba }
        r9 = 1;
        r10 = 0;
    L_0x0066:
        if (r9 >= r8) goto L_0x00b2;
    L_0x0068:
        r2 = 0;
        r11 = 0;
        r12 = 0;
        r13 = 0;
        r14 = r9;
    L_0x006d:
        r15 = r4.length();	 Catch:{ NumberFormatException -> 0x00ba }
        if (r14 >= r15) goto L_0x009b;
    L_0x0073:
        r15 = r4.charAt(r14);	 Catch:{ NumberFormatException -> 0x00ba }
        r7 = 32;
        if (r15 == r7) goto L_0x0091;
    L_0x007b:
        r7 = 101; // 0x65 float:1.42E-43 double:5.0E-322;
        if (r15 == r6) goto L_0x008f;
    L_0x007f:
        if (r15 == r7) goto L_0x008f;
    L_0x0081:
        switch(r15) {
            case 44: goto L_0x0093;
            case 45: goto L_0x0089;
            case 46: goto L_0x0085;
            default: goto L_0x0084;
        };	 Catch:{ NumberFormatException -> 0x00ba }
    L_0x0084:
        goto L_0x0094;
    L_0x0085:
        if (r12 != 0) goto L_0x008d;
    L_0x0087:
        r12 = 1;
        goto L_0x0094;
    L_0x0089:
        if (r14 == r9) goto L_0x0094;
    L_0x008b:
        if (r13 != 0) goto L_0x0094;
    L_0x008d:
        r11 = 1;
        goto L_0x0093;
    L_0x008f:
        r13 = 1;
        goto L_0x0095;
    L_0x0091:
        r7 = 101; // 0x65 float:1.42E-43 double:5.0E-322;
    L_0x0093:
        r2 = 1;
    L_0x0094:
        r13 = 0;
    L_0x0095:
        if (r2 == 0) goto L_0x0098;
    L_0x0097:
        goto L_0x009b;
    L_0x0098:
        r14 = r14 + 1;
        goto L_0x006d;
    L_0x009b:
        if (r9 >= r14) goto L_0x00aa;
    L_0x009d:
        r2 = r10 + 1;
        r9 = r4.substring(r9, r14);	 Catch:{ NumberFormatException -> 0x00ba }
        r9 = java.lang.Float.parseFloat(r9);	 Catch:{ NumberFormatException -> 0x00ba }
        r5[r10] = r9;	 Catch:{ NumberFormatException -> 0x00ba }
        r10 = r2;
    L_0x00aa:
        if (r11 == 0) goto L_0x00ad;
    L_0x00ac:
        goto L_0x00af;
    L_0x00ad:
        r14 = r14 + 1;
    L_0x00af:
        r9 = r14;
        r2 = 0;
        goto L_0x0066;
    L_0x00b2:
        r2 = a0(r5, r2, r10);	 Catch:{ NumberFormatException -> 0x00ba }
        r5 = 0;
        r5 = r2;
        r2 = 0;
        goto L_0x00cb;
    L_0x00ba:
        r0 = move-exception;
        r1 = new java.lang.RuntimeException;
        r2 = "error in parsing \"";
        r3 = "\"";
        r2 = c.b.a.a.a.E(r2, r4, r3);
        r1.<init>(r2, r0);
        throw r1;
    L_0x00c9:
        r5 = new float[r2];
    L_0x00cb:
        r2 = r4.charAt(r2);
        r4 = new b.i.d.c;
        r4.m475init(r2, r5);
        r1.add(r4);
    L_0x00d7:
        r2 = r3 + 1;
        r4 = 0;
        r4 = r3;
        r3 = r2;
        r2 = 0;
        goto L_0x000e;
    L_0x00df:
        r3 = r3 - r4;
        r2 = 1;
        if (r3 != r2) goto L_0x00f8;
    L_0x00e3:
        r2 = r16.length();
        if (r4 >= r2) goto L_0x00f8;
    L_0x00e9:
        r0 = r0.charAt(r4);
        r2 = 0;
        r2 = new float[r2];
        r3 = new b.i.d.c;
        r3.m475init(r0, r2);
        r1.add(r3);
    L_0x00f8:
        r0 = r1.size();
        r0 = new b.i.d.c[r0];
        r0 = r1.toArray(r0);
        r0 = (b.i.d.c[]) r0;
        return r0;
        */
        throw new UnsupportedOperationException("Method not decompiled: b.i.b.f.g0(java.lang.String):b.i.d.c[]");
    }

    public static void g1(XmlPullParser xmlPullParser) throws XmlPullParserException, IOException {
        int i = 1;
        while (i > 0) {
            int next = xmlPullParser.next();
            if (next == 2) {
                i++;
            } else if (next == 3) {
                i--;
            }
        }
    }

    public static String h(Context context) {
        Enum enumR = c.c.c.a.o.b.b.NONE;
        Enum enumR2 = c.c.c.a.o.b.b.MOBILE;
        try {
            ConnectivityManager connectivityManager = (ConnectivityManager) context.getSystemService("connectivity");
            if (connectivityManager != null) {
                NetworkInfo activeNetworkInfo = connectivityManager.getActiveNetworkInfo();
                if (activeNetworkInfo != null) {
                    if (activeNetworkInfo.isAvailable()) {
                        int type = activeNetworkInfo.getType();
                        if (1 == type) {
                            enumR = c.c.c.a.o.b.b.WIFI;
                        } else {
                            if (type == 0) {
                                switch (((TelephonyManager) context.getSystemService("phone")).getNetworkType()) {
                                    case 3:
                                    case 5:
                                    case 6:
                                    case 8:
                                    case 9:
                                    case 10:
                                    case 12:
                                    case 14:
                                    case 15:
                                        enumR = c.c.c.a.o.b.b.MOBILE_3G;
                                        break;
                                    case 13:
                                        enumR = c.c.c.a.o.b.b.MOBILE_4G;
                                        break;
                                    default:
                                        break;
                                }
                            }
                            enumR = enumR2;
                        }
                    }
                }
            }
        } catch (Throwable unused) {
        }
        try {
            int i = c.c.c.a.m.e.a[enumR.ordinal()];
            if (i == 1) {
                return "wifi";
            }
            if (i == 2) {
                return "2g";
            }
            if (i == 3) {
                return "3g";
            }
            if (i != 4) {
                return i != 5 ? "" : "mobile";
            } else {
                return "4g";
            }
        } catch (Exception unused2) {
        }
    }

    public static <T extends Parcelable> T h0(Parcel parcel, int i, Creator<T> creator) {
        i = T0(parcel, i);
        int dataPosition = parcel.dataPosition();
        if (i == 0) {
            return null;
        }
        Parcelable parcelable = (Parcelable) creator.createFromParcel(parcel);
        parcel.setDataPosition(dataPosition + i);
        return parcelable;
    }

    public static void h1(Parcel parcel, int i) {
        parcel.setDataPosition(parcel.dataPosition() + T0(parcel, i));
    }

    public static String i(c.c.b.a.b.w wVar) {
        String m = wVar.m();
        String o = wVar.o();
        if (o == null) {
            return m;
        }
        StringBuilder stringBuilder = new StringBuilder();
        stringBuilder.append(m);
        stringBuilder.append('?');
        stringBuilder.append(o);
        return stringBuilder.toString();
    }

    public static Path i0(String str) {
        Path path = new Path();
        b.i.d.c[] g0 = g0(str);
        if (g0 == null) {
            return null;
        }
        try {
            b.i.d.c.b(g0, path);
            return path;
        } catch (RuntimeException e) {
            throw new RuntimeException(c.b.a.a.a.D("Error in parsing ", str), e);
        }
    }

    public static List<byte[]> i1(String[] strArr) {
        ArrayList arrayList = new ArrayList();
        for (String decode : strArr) {
            arrayList.add(Base64.decode(decode, 0));
        }
        return arrayList;
    }

    public static String j(File file, String str, String str2, JSONObject jSONObject, boolean z) {
        if (!file.exists()) {
            file.mkdirs();
        }
        File file2 = new File(file, str);
        JSONObject jSONObject2 = new JSONObject();
        try {
            jSONObject2.put(HwPayConstant.KEY_URL, str2);
            jSONObject2.put("body", jSONObject);
            jSONObject2.put("dump_file", "");
            jSONObject2.put("encrypt", z);
            q(file2, jSONObject2.toString(), false);
        } catch (JSONException e) {
            e.printStackTrace();
        } catch (IOException e2) {
            e2.printStackTrace();
        }
        return file2.getAbsolutePath();
    }

    public static String j0(Parcel parcel, int i) {
        i = T0(parcel, i);
        int dataPosition = parcel.dataPosition();
        if (i == 0) {
            return null;
        }
        String readString = parcel.readString();
        parcel.setDataPosition(dataPosition + i);
        return readString;
    }

    public static int j1(Parcel parcel) {
        int readInt = parcel.readInt();
        int T0 = T0(parcel, readInt);
        int dataPosition = parcel.dataPosition();
        if ((65535 & readInt) != 20293) {
            String str = "Expected object header. Got 0x";
            String valueOf = String.valueOf(Integer.toHexString(readInt));
            throw new c.e.a.b.b.h.i.a(valueOf.length() != 0 ? str.concat(valueOf) : new String(str), parcel);
        }
        T0 += dataPosition;
        if (T0 >= dataPosition && T0 <= parcel.dataSize()) {
            return T0;
        }
        StringBuilder stringBuilder = new StringBuilder(54);
        stringBuilder.append("Size read is invalid start=");
        stringBuilder.append(dataPosition);
        stringBuilder.append(" end=");
        stringBuilder.append(T0);
        throw new c.e.a.b.b.h.i.a(stringBuilder.toString(), parcel);
    }

    /* JADX WARNING: Missing exception handler attribute for start block: B:16:0x0032 */
    /* JADX WARNING: Failed to process nested try/catch */
    /* JADX WARNING: Missing block: B:17:?, code skipped:
            r6 = "";
     */
    /* JADX WARNING: Missing block: B:18:0x0037, code skipped:
            return r6;
     */
    /* JADX WARNING: Missing block: B:20:0x0039, code skipped:
            r1.close();
     */
    public static java.lang.String k(java.lang.Throwable r6) {
        /*
        r0 = new java.io.StringWriter;
        r0.<init>();
        r1 = new java.io.PrintWriter;
        r1.<init>(r0);
        r2 = 0;
        r4 = 0;
        r3 = r6;
    L_0x000d:
        if (r3 == 0) goto L_0x0021;
    L_0x000f:
        r5 = r3 instanceof java.lang.StackOverflowError;	 Catch:{ Exception -> 0x0032 }
        if (r5 == 0) goto L_0x0015;
    L_0x0013:
        r2 = 1;
        goto L_0x0021;
    L_0x0015:
        r5 = 20;
        if (r4 <= r5) goto L_0x001a;
    L_0x0019:
        goto L_0x0021;
    L_0x001a:
        r3 = r3.getCause();	 Catch:{ Exception -> 0x0032 }
        r4 = r4 + 1;
        goto L_0x000d;
    L_0x0021:
        if (r2 == 0) goto L_0x0027;
    L_0x0023:
        s(r6, r1);	 Catch:{ Exception -> 0x0032 }
        goto L_0x002a;
    L_0x0027:
        r6.printStackTrace(r1);	 Catch:{ Exception -> 0x0032 }
    L_0x002a:
        r6 = r0.toString();	 Catch:{ Exception -> 0x0032 }
        r1.close();
        return r6;
    L_0x0032:
        r6 = "";
        r1.close();
        return r6;
    L_0x0038:
        r6 = move-exception;
        r1.close();
        throw r6;
        */
        throw new UnsupportedOperationException("Method not decompiled: b.i.b.f.k(java.lang.Throwable):java.lang.String");
    }

    public static ArrayList<String> k0(Parcel parcel, int i) {
        i = T0(parcel, i);
        int dataPosition = parcel.dataPosition();
        if (i == 0) {
            return null;
        }
        ArrayList createStringArrayList = parcel.createStringArrayList();
        parcel.setDataPosition(dataPosition + i);
        return createStringArrayList;
    }

    public static Drawable k1(Drawable drawable) {
        return (VERSION.SDK_INT < 23 && !(drawable instanceof b.i.d.l.a)) ? new b.i.d.l.d(drawable) : drawable;
    }

    public static String l(Map<String, String> map, String str) {
        String str2 = (String) map.get("Content-Type");
        if (str2 != null) {
            String[] split = str2.split(";", 0);
            for (int i = 1; i < split.length; i++) {
                String[] split2 = split[i].trim().split(ContainerUtils.KEY_VALUE_DELIMITER, 0);
                if (split2.length == 2 && split2[0].equals("charset")) {
                    return split2[1];
                }
            }
        }
        return str;
    }

    public static <T> T[] l0(Parcel parcel, int i, Creator<T> creator) {
        i = T0(parcel, i);
        int dataPosition = parcel.dataPosition();
        if (i == 0) {
            return null;
        }
        Object[] createTypedArray = parcel.createTypedArray(creator);
        parcel.setDataPosition(dataPosition + i);
        return createTypedArray;
    }

    public static Callback l1(TextView textView, Callback callback) {
        int i = VERSION.SDK_INT;
        return (i < 26 || i > 27 || (callback instanceof b.i.l.d)) ? callback : new b.i.l.d(callback, textView);
    }

    /* JADX WARNING: Removed duplicated region for block: B:48:0x0029 A:{SYNTHETIC} */
    /* JADX WARNING: Removed duplicated region for block: B:21:0x006e A:{Catch:{ all -> 0x0105 }} */
    public static org.json.JSONObject m(java.lang.String r16) {
        /*
        r0 = r16;
        r1 = ")";
        r2 = "(";
        r3 = 0;
        r4 = java.lang.Thread.getAllStackTraces();	 Catch:{ all -> 0x0105 }
        r5 = new org.json.JSONObject;	 Catch:{ all -> 0x0105 }
        r5.<init>();	 Catch:{ all -> 0x0105 }
        if (r4 != 0) goto L_0x0013;
    L_0x0012:
        return r3;
    L_0x0013:
        r6 = "thread_all_count";
        r7 = r4.size();	 Catch:{ all -> 0x0105 }
        r5.put(r6, r7);	 Catch:{ all -> 0x0105 }
        r6 = new org.json.JSONArray;	 Catch:{ all -> 0x0105 }
        r6.<init>();	 Catch:{ all -> 0x0105 }
        r4 = r4.entrySet();	 Catch:{ all -> 0x0105 }
        r4 = r4.iterator();	 Catch:{ all -> 0x0105 }
    L_0x0029:
        r7 = r4.hasNext();	 Catch:{ all -> 0x0105 }
        if (r7 == 0) goto L_0x00ff;
    L_0x002f:
        r7 = r4.next();	 Catch:{ all -> 0x0105 }
        r7 = (java.util.Map.Entry) r7;	 Catch:{ all -> 0x0105 }
        r8 = new org.json.JSONObject;	 Catch:{ all -> 0x0105 }
        r8.<init>();	 Catch:{ all -> 0x0105 }
        r9 = r7.getKey();	 Catch:{ all -> 0x0105 }
        r9 = (java.lang.Thread) r9;	 Catch:{ all -> 0x0105 }
        r10 = r9.getName();	 Catch:{ all -> 0x0105 }
        r11 = c.c.c.a.m.d.a;	 Catch:{ all -> 0x0105 }
        r12 = r11.contains(r10);	 Catch:{ all -> 0x0105 }
        if (r12 == 0) goto L_0x004d;
    L_0x004c:
        goto L_0x0069;
    L_0x004d:
        r11 = r11.iterator();	 Catch:{ all -> 0x0105 }
    L_0x0051:
        r12 = r11.hasNext();	 Catch:{ all -> 0x0105 }
        if (r12 == 0) goto L_0x006b;
    L_0x0057:
        r12 = r11.next();	 Catch:{ all -> 0x0105 }
        r12 = (java.lang.String) r12;	 Catch:{ all -> 0x0105 }
        r15 = android.text.TextUtils.isEmpty(r10);	 Catch:{ all -> 0x0105 }
        if (r15 != 0) goto L_0x0051;
    L_0x0063:
        r12 = r10.startsWith(r12);	 Catch:{ all -> 0x0105 }
        if (r12 == 0) goto L_0x0051;
    L_0x0069:
        r11 = 1;
        goto L_0x006c;
    L_0x006b:
        r11 = 0;
    L_0x006c:
        if (r11 != 0) goto L_0x0029;
    L_0x006e:
        if (r0 == 0) goto L_0x0083;
    L_0x0070:
        r11 = r0.equals(r10);	 Catch:{ all -> 0x0105 }
        if (r11 != 0) goto L_0x0029;
    L_0x0076:
        r11 = r10.startsWith(r0);	 Catch:{ all -> 0x0105 }
        if (r11 != 0) goto L_0x0029;
    L_0x007c:
        r10 = r10.endsWith(r0);	 Catch:{ all -> 0x0105 }
        if (r10 == 0) goto L_0x0083;
    L_0x0082:
        goto L_0x0029;
    L_0x0083:
        r10 = "thread_name";
        r11 = new java.lang.StringBuilder;	 Catch:{ all -> 0x0105 }
        r11.<init>();	 Catch:{ all -> 0x0105 }
        r12 = r9.getName();	 Catch:{ all -> 0x0105 }
        r11.append(r12);	 Catch:{ all -> 0x0105 }
        r11.append(r2);	 Catch:{ all -> 0x0105 }
        r13 = r9.getId();	 Catch:{ all -> 0x0105 }
        r11.append(r13);	 Catch:{ all -> 0x0105 }
        r11.append(r1);	 Catch:{ all -> 0x0105 }
        r9 = r11.toString();	 Catch:{ all -> 0x0105 }
        r8.put(r10, r9);	 Catch:{ all -> 0x0105 }
        r7 = r7.getValue();	 Catch:{ all -> 0x0105 }
        r7 = (java.lang.StackTraceElement[]) r7;	 Catch:{ all -> 0x0105 }
        if (r7 == 0) goto L_0x00f7;
    L_0x00ad:
        r9 = new org.json.JSONArray;	 Catch:{ all -> 0x0105 }
        r9.<init>();	 Catch:{ all -> 0x0105 }
        r10 = r7.length;	 Catch:{ all -> 0x0105 }
        r11 = 0;
    L_0x00b4:
        if (r11 >= r10) goto L_0x00e7;
    L_0x00b6:
        r13 = r7[r11];	 Catch:{ all -> 0x0105 }
        r14 = r13.getClassName();	 Catch:{ all -> 0x0105 }
        r12 = new java.lang.StringBuilder;	 Catch:{ all -> 0x0105 }
        r12.<init>();	 Catch:{ all -> 0x0105 }
        r12.append(r14);	 Catch:{ all -> 0x0105 }
        r14 = ".";
        r12.append(r14);	 Catch:{ all -> 0x0105 }
        r14 = r13.getMethodName();	 Catch:{ all -> 0x0105 }
        r12.append(r14);	 Catch:{ all -> 0x0105 }
        r12.append(r2);	 Catch:{ all -> 0x0105 }
        r13 = r13.getLineNumber();	 Catch:{ all -> 0x0105 }
        r12.append(r13);	 Catch:{ all -> 0x0105 }
        r12.append(r1);	 Catch:{ all -> 0x0105 }
        r12 = r12.toString();	 Catch:{ all -> 0x0105 }
        r9.put(r12);	 Catch:{ all -> 0x0105 }
        r11 = r11 + 1;
        goto L_0x00b4;
    L_0x00e7:
        r7 = "thread_stack";
        r8.put(r7, r9);	 Catch:{ all -> 0x0105 }
        r7 = r9.length();	 Catch:{ all -> 0x0105 }
        if (r7 <= 0) goto L_0x00f4;
    L_0x00f2:
        r13 = 1;
        goto L_0x00f5;
    L_0x00f4:
        r13 = 0;
    L_0x00f5:
        r14 = r13;
        goto L_0x00f8;
    L_0x00f7:
        r14 = 1;
    L_0x00f8:
        if (r14 == 0) goto L_0x0029;
    L_0x00fa:
        r6.put(r8);	 Catch:{ all -> 0x0105 }
        goto L_0x0029;
    L_0x00ff:
        r0 = "thread_stacks";
        r5.put(r0, r6);	 Catch:{ all -> 0x0105 }
        return r5;
    L_0x0105:
        return r3;
        */
        throw new UnsupportedOperationException("Method not decompiled: b.i.b.f.m(java.lang.String):org.json.JSONObject");
    }

    public static void m0(String str, String str2, Object obj) {
        Log.d(y0(str), String.format(str2, new Object[]{obj}));
    }

    public static void m1(Parcel parcel, int i, Bundle bundle, boolean z) {
        if (bundle == null) {
            if (z) {
                v1(parcel, i, 0);
            }
            return;
        }
        i = q1(parcel, i);
        parcel.writeBundle(bundle);
        u1(parcel, i);
    }

    public static void n(Context context) {
        if (JLibrary.context == null) {
            JLibrary.InitEntry(context);
        }
    }

    public static void n0(String str, String str2, Object... objArr) {
        Log.d(y0(str), String.format(str2, objArr));
    }

    public static void n1(Parcel parcel, int i, Parcelable parcelable, int i2, boolean z) {
        if (parcelable == null) {
            if (z) {
                v1(parcel, i, 0);
            }
            return;
        }
        i = q1(parcel, i);
        parcelable.writeToParcel(parcel, i2);
        u1(parcel, i);
    }

    public static void o(Context context, int i, String str) {
        try {
            LinkedHashMap linkedHashMap = new LinkedHashMap();
            if (i == 1) {
                linkedHashMap.put("tnc_config", str);
            }
            StringBuilder stringBuilder = new StringBuilder();
            stringBuilder.append("saveData = ");
            stringBuilder.append(str);
            c.c.b.b.g.b.a("MultiProcessFileUtils", stringBuilder.toString());
            c.c.b.b.c.a().a(context, linkedHashMap);
        } catch (Exception unused) {
        }
    }

    public static b.i.d.c[] o0(b.i.d.c[] cVarArr) {
        if (cVarArr == null) {
            return null;
        }
        b.i.d.c[] cVarArr2 = new b.i.d.c[cVarArr.length];
        for (int i = 0; i < cVarArr.length; i++) {
            cVarArr2[i] = new b.i.d.c(cVarArr[i]);
        }
        return cVarArr2;
    }

    public static void o1(Parcel parcel, int i, String str, boolean z) {
        if (str == null) {
            if (z) {
                v1(parcel, i, 0);
            }
            return;
        }
        i = q1(parcel, i);
        parcel.writeString(str);
        u1(parcel, i);
    }

    public static void p(Context context, String str, String str2) {
        String str3 = " ";
        try {
            StringBuilder stringBuilder = new StringBuilder();
            stringBuilder.append(System.currentTimeMillis());
            stringBuilder.append(str3);
            stringBuilder.append(str);
            stringBuilder.append(str3);
            if (str2 == null) {
                str2 = "null";
            }
            stringBuilder.append(str2);
            stringBuilder.append("\n");
            q(new File(G(context), "crash_history"), stringBuilder.toString(), true);
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

    public static void p0(String str, String str2, Throwable th) {
        Log.e(y0(str), str2, th);
    }

    public static <T extends Parcelable> void p1(Parcel parcel, int i, T[] tArr, int i2, boolean z) {
        if (tArr == null) {
            if (z) {
                v1(parcel, i, 0);
            }
            return;
        }
        i = q1(parcel, i);
        parcel.writeInt(r9);
        for (Parcelable parcelable : tArr) {
            if (parcelable == null) {
                parcel.writeInt(0);
            } else {
                int dataPosition = parcel.dataPosition();
                parcel.writeInt(1);
                int dataPosition2 = parcel.dataPosition();
                parcelable.writeToParcel(parcel, i2);
                int dataPosition3 = parcel.dataPosition();
                parcel.setDataPosition(dataPosition);
                parcel.writeInt(dataPosition3 - dataPosition2);
                parcel.setDataPosition(dataPosition3);
            }
        }
        u1(parcel, i);
    }

    /* JADX WARNING: Removed duplicated region for block: B:16:0x0028 A:{SYNTHETIC, Splitter:B:16:0x0028} */
    public static void q(java.io.File r2, java.lang.String r3, boolean r4) throws java.io.IOException {
        /*
        r0 = android.text.TextUtils.isEmpty(r3);
        if (r0 == 0) goto L_0x0007;
    L_0x0006:
        return;
    L_0x0007:
        r0 = r2.getParentFile();
        r0.mkdirs();
        r0 = 0;
        r1 = new java.io.FileOutputStream;	 Catch:{ all -> 0x0025 }
        r1.<init>(r2, r4);	 Catch:{ all -> 0x0025 }
        r2 = r3.getBytes();	 Catch:{ all -> 0x0022 }
        r1.write(r2);	 Catch:{ all -> 0x0022 }
        r1.flush();	 Catch:{ all -> 0x0022 }
        r1.close();	 Catch:{ all -> 0x0021 }
    L_0x0021:
        return;
    L_0x0022:
        r2 = move-exception;
        r0 = r1;
        goto L_0x0026;
    L_0x0025:
        r2 = move-exception;
    L_0x0026:
        if (r0 == 0) goto L_0x002b;
    L_0x0028:
        r0.close();	 Catch:{ all -> 0x002b }
    L_0x002b:
        throw r2;
        */
        throw new UnsupportedOperationException("Method not decompiled: b.i.b.f.q(java.io.File, java.lang.String, boolean):void");
    }

    public static void q0(Parcel parcel, int i) {
        if (parcel.dataPosition() != i) {
            StringBuilder stringBuilder = new StringBuilder(37);
            stringBuilder.append("Overread allowed size end=");
            stringBuilder.append(i);
            throw new c.e.a.b.b.h.i.a(stringBuilder.toString(), parcel);
        }
    }

    public static int q1(Parcel parcel, int i) {
        parcel.writeInt(i | -65536);
        parcel.writeInt(0);
        return parcel.dataPosition();
    }

    public static void r(Throwable th, c.c.c.a.m.h hVar, StackTraceElement[] stackTraceElementArr, String str, String str2, Set<Throwable> set) {
        StringBuilder stringBuilder;
        if (set.contains(th)) {
            stringBuilder = new StringBuilder();
            stringBuilder.append("\t[CIRCULAR REFERENCE:");
            stringBuilder.append(th);
            stringBuilder.append("]");
            hVar.a.println(stringBuilder.toString());
            return;
        }
        StringBuilder g;
        set.add(th);
        StackTraceElement[] stackTrace = th.getStackTrace();
        int min = Math.min(stackTrace.length, 256);
        int i = min - 1;
        int min2 = Math.min(stackTraceElementArr.length, 256) - 1;
        int i2 = i;
        while (i2 >= 0 && min2 >= 0 && stackTrace[i2].equals(stackTraceElementArr[min2])) {
            i2--;
            min2--;
        }
        i -= i2;
        stringBuilder = new StringBuilder();
        stringBuilder.append(str2);
        stringBuilder.append(str);
        stringBuilder.append(th);
        hVar.a.println(stringBuilder.toString());
        for (int i3 = 0; i3 <= i2; i3++) {
            StringBuilder i4 = c.b.a.a.a.i(str2, "\tat ");
            i4.append(stackTrace[i3]);
            hVar.a.println(i4.toString());
        }
        if (min < stackTrace.length) {
            g = c.b.a.a.a.g("\t... skip ");
            g.append(stackTrace.length - min);
            g.append(" lines");
            hVar.a.println(g.toString());
        }
        if (i != 0) {
            g = new StringBuilder();
            g.append(str2);
            g.append("\t... ");
            g.append(i);
            g.append(" more");
            hVar.a.println(g.toString());
        }
        for (Throwable r : th.getSuppressed()) {
            r(r, hVar, stackTrace, "Suppressed: ", c.b.a.a.a.D(str2, "\t"), set);
        }
        Throwable r2 = th.getCause();
        if (r2 != null) {
            r(r2, hVar, stackTrace, "Caused by: ", str2, set);
        }
    }

    public static boolean r0(Object obj, Object obj2) {
        return obj == obj2 || (obj != null && obj.equals(obj2));
    }

    public static String r1(String str, String str2) {
        int length = str.length() - str2.length();
        if (length < 0 || length > 1) {
            throw new IllegalArgumentException("Invalid input received");
        }
        StringBuilder stringBuilder = new StringBuilder(str2.length() + str.length());
        for (int i = 0; i < str.length(); i++) {
            stringBuilder.append(str.charAt(i));
            if (str2.length() > i) {
                stringBuilder.append(str2.charAt(i));
            }
        }
        return stringBuilder.toString();
    }

    public static void s(Throwable th, PrintWriter printWriter) {
        if (th != null) {
            c.c.c.a.m.h hVar = new c.c.c.a.m.h(printWriter);
            Set newSetFromMap = Collections.newSetFromMap(new IdentityHashMap());
            newSetFromMap.add(th);
            synchronized (hVar.a) {
                hVar.a.println(th);
                StackTraceElement[] stackTrace = th.getStackTrace();
                int i = 0;
                for (Object obj : stackTrace) {
                    if (i > 256) {
                        StringBuilder stringBuilder = new StringBuilder();
                        stringBuilder.append("\t... skip ");
                        stringBuilder.append(stackTrace.length - i);
                        stringBuilder.append(" lines");
                        hVar.a.println(stringBuilder.toString());
                        break;
                    }
                    StringBuilder stringBuilder2 = new StringBuilder();
                    stringBuilder2.append("\tat ");
                    stringBuilder2.append(obj);
                    hVar.a.println(stringBuilder2.toString());
                    i++;
                }
                for (Throwable r : th.getSuppressed()) {
                    r(r, hVar, stackTrace, "Suppressed: ", "\t", newSetFromMap);
                }
                Throwable r2 = th.getCause();
                if (r2 != null) {
                    r(r2, hVar, stackTrace, "Caused by: ", "", newSetFromMap);
                }
            }
        }
    }

    public static int s0(float f, int i, int i2) {
        if (i == i2) {
            return i;
        }
        float f2 = ((float) ((i >> 24) & ISdkLite.REGION_UNSET)) / 255.0f;
        float f3 = ((float) ((i >> 8) & ISdkLite.REGION_UNSET)) / 255.0f;
        float f4 = ((float) (i & ISdkLite.REGION_UNSET)) / 255.0f;
        float f5 = ((float) ((i2 >> 24) & ISdkLite.REGION_UNSET)) / 255.0f;
        float f6 = ((float) ((i2 >> 16) & ISdkLite.REGION_UNSET)) / 255.0f;
        float f7 = ((float) ((i2 >> 8) & ISdkLite.REGION_UNSET)) / 255.0f;
        float f8 = ((float) (i2 & ISdkLite.REGION_UNSET)) / 255.0f;
        float a = a(((float) ((i >> 16) & ISdkLite.REGION_UNSET)) / 255.0f);
        f3 = a(f3);
        f4 = a(f4);
        f6 = a(f6);
        f7 = a(f7);
        f8 = a(f8);
        f2 = c.b.a.a.a.a(f5, f2, f, f2);
        a = c.b.a.a.a.a(f6, a, f, a);
        f3 = c.b.a.a.a.a(f7, f3, f, f3);
        f = c.b.a.a.a.a(f8, f4, f, f4);
        int round = Math.round(f2 * 255.0f) << 24;
        return Math.round(b(f) * 255.0f) | (((Math.round(b(a) * 255.0f) << 16) | round) | (Math.round(b(f3) * 255.0f) << 8));
    }

    public static void s1(Parcel parcel, int i, int i2) {
        i = T0(parcel, i);
        if (i != i2) {
            String toHexString = Integer.toHexString(i);
            StringBuilder stringBuilder = new StringBuilder(String.valueOf(toHexString).length() + 46);
            stringBuilder.append("Expected size ");
            stringBuilder.append(i2);
            stringBuilder.append(" got ");
            stringBuilder.append(i);
            throw new c.e.a.b.b.h.i.a(c.b.a.a.a.e(stringBuilder, " (0x", toHexString, ")"), parcel);
        }
    }

    public static boolean t() {
        return "mounted".equals(Environment.getExternalStorageState());
    }

    public static Drawable t0(CompoundButton compoundButton) {
        if (VERSION.SDK_INT >= 23) {
            return compoundButton.getButtonDrawable();
        }
        String str = "CompoundButtonCompat";
        if (!f) {
            try {
                Field declaredField = CompoundButton.class.getDeclaredField("mButtonDrawable");
                e = declaredField;
                declaredField.setAccessible(true);
            } catch (NoSuchFieldException e) {
                Log.i(str, "Failed to retrieve mButtonDrawable field", e);
            }
            f = true;
        }
        Field field = e;
        if (field != null) {
            try {
                return (Drawable) field.get(compoundButton);
            } catch (IllegalAccessException e2) {
                Log.i(str, "Failed to get button drawable via reflection", e2);
                e = null;
            }
        }
        return null;
    }

    public static void t1(Parcel parcel, int i, int i2) {
        if (i != i2) {
            String toHexString = Integer.toHexString(i);
            StringBuilder stringBuilder = new StringBuilder(String.valueOf(toHexString).length() + 46);
            stringBuilder.append("Expected size ");
            stringBuilder.append(i2);
            stringBuilder.append(" got ");
            stringBuilder.append(i);
            throw new c.e.a.b.b.h.i.a(c.b.a.a.a.e(stringBuilder, " (0x", toHexString, ")"), parcel);
        }
    }

    public static boolean u(File file) {
        return file.exists() && file.delete();
    }

    public static int u0(Drawable drawable) {
        if (VERSION.SDK_INT >= 23) {
            return drawable.getLayoutDirection();
        }
        String str = "DrawableCompat";
        if (!d) {
            try {
                Method declaredMethod = Drawable.class.getDeclaredMethod("getLayoutDirection", new Class[0]);
                c = declaredMethod;
                declaredMethod.setAccessible(true);
            } catch (NoSuchMethodException e) {
                Log.i(str, "Failed to retrieve getLayoutDirection() method", e);
            }
            d = true;
        }
        Method method = c;
        if (method != null) {
            try {
                return ((Integer) method.invoke(drawable, new Object[0])).intValue();
            } catch (Exception e2) {
                Log.i(str, "Failed to invoke getLayoutDirection() via reflection", e2);
                c = null;
            }
        }
        return 0;
    }

    public static void u1(Parcel parcel, int i) {
        int dataPosition = parcel.dataPosition();
        int i2 = dataPosition - i;
        parcel.setDataPosition(i - 4);
        parcel.writeInt(i2);
        parcel.setDataPosition(dataPosition);
    }

    public static boolean v(File file, boolean z) {
        if (!z || file.isFile()) {
            return u(file);
        }
        boolean z2 = true;
        if (file.isDirectory()) {
            File[] listFiles = file.listFiles();
            int i = 0;
            int i2 = 1;
            while (listFiles != null && i < listFiles.length) {
                int u;
                if (listFiles[i].isFile()) {
                    u = u(listFiles[i]);
                } else {
                    u = v(listFiles[i], true);
                }
                i2 &= u;
                i++;
            }
            z2 = i2 & u(file);
        }
        return z2;
    }

    public static Intent v0(Activity activity) {
        Intent parentActivityIntent = activity.getParentActivityIntent();
        if (parentActivityIntent != null) {
            return parentActivityIntent;
        }
        try {
            String x0 = x0(activity, activity.getComponentName());
            if (x0 == null) {
                return null;
            }
            ComponentName componentName = new ComponentName(activity, x0);
            try {
                Intent makeMainActivity;
                if (x0(activity, componentName) == null) {
                    makeMainActivity = Intent.makeMainActivity(componentName);
                } else {
                    makeMainActivity = new Intent().setComponent(componentName);
                }
                return makeMainActivity;
            } catch (NameNotFoundException unused) {
                StringBuilder stringBuilder = new StringBuilder();
                stringBuilder.append("getParentActivityIntent: bad parentActivityName '");
                stringBuilder.append(x0);
                stringBuilder.append("' in manifest");
                Log.e("NavUtils", stringBuilder.toString());
                return null;
            }
        } catch (NameNotFoundException e) {
            throw new IllegalArgumentException(e);
        }
    }

    public static void v1(Parcel parcel, int i, int i2) {
        if (i2 >= 65535) {
            parcel.writeInt(i | -65536);
            parcel.writeInt(i2);
            return;
        }
        parcel.writeInt(i | (i2 << 16));
    }

    public static boolean w(Context context) {
        try {
            ConnectivityManager connectivityManager = (ConnectivityManager) context.getSystemService("connectivity");
            if (connectivityManager == null) {
                return false;
            }
            NetworkInfo[] allNetworkInfo = connectivityManager.getAllNetworkInfo();
            if (allNetworkInfo != null) {
                for (NetworkInfo networkInfo : allNetworkInfo) {
                    if (networkInfo.getState() == State.CONNECTED || networkInfo.getState() == State.CONNECTING) {
                        return true;
                    }
                }
            }
            return false;
        } catch (Throwable th) {
            Log.e("ignored", th.toString());
        }
    }

    public static Intent w0(Context context, ComponentName componentName) throws NameNotFoundException {
        String x0 = x0(context, componentName);
        if (x0 == null) {
            return null;
        }
        Intent makeMainActivity;
        ComponentName componentName2 = new ComponentName(componentName.getPackageName(), x0);
        if (x0(context, componentName2) == null) {
            makeMainActivity = Intent.makeMainActivity(componentName2);
        } else {
            makeMainActivity = new Intent().setComponent(componentName2);
        }
        return makeMainActivity;
    }

    public static boolean x(String str) {
        boolean z = false;
        if (TextUtils.isEmpty(str)) {
            return false;
        }
        File file = new File(str);
        if (file.exists() && file.delete()) {
            z = true;
        }
        return z;
    }

    public static String x0(Context context, ComponentName componentName) throws NameNotFoundException {
        PackageManager packageManager = context.getPackageManager();
        int i = VERSION.SDK_INT;
        int i2 = 640;
        if (i >= 29) {
            i2 = 269222528;
        } else if (i >= 24) {
            i2 = 787072;
        }
        ActivityInfo activityInfo = packageManager.getActivityInfo(componentName, i2);
        String str = activityInfo.parentActivityName;
        if (str != null) {
            return str;
        }
        Bundle bundle = activityInfo.metaData;
        if (bundle == null) {
            return null;
        }
        String string = bundle.getString("android.support.PARENT_ACTIVITY");
        if (string == null) {
            return null;
        }
        if (string.charAt(0) == '.') {
            StringBuilder stringBuilder = new StringBuilder();
            stringBuilder.append(context.getPackageName());
            stringBuilder.append(string);
            string = stringBuilder.toString();
        }
        return string;
    }

    public static String y(Context context) {
        NetworkInfo activeNetworkInfo;
        try {
            activeNetworkInfo = ((ConnectivityManager) context.getSystemService("connectivity")).getActiveNetworkInfo();
        } catch (SecurityException e) {
            m0.b(e);
        } catch (Throwable unused) {
        }
        if (activeNetworkInfo == null && activeNetworkInfo.isAvailable()) {
            int type = activeNetworkInfo.getType();
            if (1 == type) {
                return "wifi";
            }
            if (type != 0) {
                return null;
            }
            switch (((TelephonyManager) context.getSystemService("phone")).getNetworkType()) {
                case 1:
                case 2:
                case 4:
                case 7:
                case 11:
                case 16:
                    return "2g";
                case 3:
                case 5:
                case 6:
                case 8:
                case 9:
                case 10:
                case 12:
                case 14:
                case 15:
                case 17:
                    return "3g";
                case 13:
                case 18:
                case ConnectionResult.SERVICE_MISSING_PERMISSION /*19*/:
                    return "4g";
                default:
                    return "mobile";
            }
        }
        activeNetworkInfo = null;
        return activeNetworkInfo == null ? null : null;
    }

    public static String y0(String str) {
        return c.b.a.a.a.D("TransportRuntime.", str);
    }

    /* JADX WARNING: Removed duplicated region for block: B:18:0x0034 A:{SYNTHETIC, Splitter:B:18:0x0034} */
    public static java.lang.String z(java.lang.String r4) throws java.io.IOException {
        /*
        r0 = android.text.TextUtils.isEmpty(r4);
        r1 = 0;
        if (r0 == 0) goto L_0x0008;
    L_0x0007:
        goto L_0x002d;
    L_0x0008:
        r0 = new java.io.File;
        r0.<init>(r4);
        r4 = new java.lang.StringBuilder;
        r4.<init>();
        r2 = new java.io.BufferedReader;	 Catch:{ all -> 0x0031 }
        r3 = new java.io.FileReader;	 Catch:{ all -> 0x0031 }
        r3.<init>(r0);	 Catch:{ all -> 0x0031 }
        r2.<init>(r3);	 Catch:{ all -> 0x0031 }
    L_0x001c:
        r0 = r2.readLine();	 Catch:{ all -> 0x002e }
        if (r0 == 0) goto L_0x0026;
    L_0x0022:
        r4.append(r0);	 Catch:{ all -> 0x002e }
        goto L_0x001c;
    L_0x0026:
        r2.close();	 Catch:{ all -> 0x0029 }
    L_0x0029:
        r1 = r4.toString();
    L_0x002d:
        return r1;
    L_0x002e:
        r4 = move-exception;
        r1 = r2;
        goto L_0x0032;
    L_0x0031:
        r4 = move-exception;
    L_0x0032:
        if (r1 == 0) goto L_0x0037;
    L_0x0034:
        r1.close();	 Catch:{ all -> 0x0037 }
    L_0x0037:
        throw r4;
        */
        throw new UnsupportedOperationException("Method not decompiled: b.i.b.f.z(java.lang.String):java.lang.String");
    }

    public static File z0(Context context) {
        File cacheDir = context.getCacheDir();
        if (cacheDir == null) {
            return null;
        }
        StringBuilder g = c.b.a.a.a.g(".font");
        g.append(Process.myPid());
        String str = "-";
        g.append(str);
        g.append(Process.myTid());
        g.append(str);
        String stringBuilder = g.toString();
        int i = 0;
        while (i < 100) {
            File file = new File(cacheDir, c.b.a.a.a.A(stringBuilder, i));
            try {
                if (file.createNewFile()) {
                    return file;
                }
                i++;
            } catch (IOException unused) {
            }
        }
        return null;
    }
}
